1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibRegex: Use AK::any_of in Parser::lookahead_any

Equivalent to std::ranges::any_of, which clang-tidy suggests.
This commit is contained in:
Hendiadyoin1 2021-12-21 18:11:00 +01:00 committed by Brian Gianforcaro
parent 0f4a79a24d
commit 303af07df8

View file

@ -7,6 +7,7 @@
#include "RegexParser.h"
#include "RegexDebug.h"
#include <AK/AnyOf.h>
#include <AK/CharacterTypes.h>
#include <AK/GenericLexer.h>
#include <AK/String.h>
@ -138,12 +139,7 @@ ALWAYS_INLINE bool Parser::try_skip(StringView str)
ALWAYS_INLINE bool Parser::lookahead_any(StringView str)
{
for (auto ch : str) {
if (match(ch))
return true;
}
return false;
return AK::any_of(str, [this](auto ch) { return match(ch); });
}
ALWAYS_INLINE unsigned char Parser::skip()