diff --git a/AK/AnyOf.h b/AK/AnyOf.h index 08750396445..201a875fda9 100644 --- a/AK/AnyOf.h +++ b/AK/AnyOf.h @@ -6,6 +6,7 @@ #pragma once +#include #include namespace AK { @@ -16,12 +17,7 @@ constexpr bool any_of( const SimpleIterator& end, const auto& predicate) { - for (auto iter = begin; iter != end; ++iter) { - if (predicate(*iter)) { - return true; - } - } - return false; + return find_if(begin, end, predicate) != end; } }