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:
parent
0f4a79a24d
commit
303af07df8
1 changed files with 2 additions and 6 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue