From b6a708dcc0a8bc2fd8f60023092609a489af092f Mon Sep 17 00:00:00 2001 From: Username404 Date: Sat, 1 Apr 2023 21:21:09 +0200 Subject: [PATCH] ReservedIdentifiers.hpp: Use std::any_of instead of std::find in the reserved function Signed-off-by: Username404 --- src/headers/parsing/ReservedIdentifiers.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/headers/parsing/ReservedIdentifiers.hpp b/src/headers/parsing/ReservedIdentifiers.hpp index 3bc29d1..fed4b5c 100644 --- a/src/headers/parsing/ReservedIdentifiers.hpp +++ b/src/headers/parsing/ReservedIdentifiers.hpp @@ -19,7 +19,9 @@ inline const char* ID(const ReservedIdentifier& identifier) { } bool reserved(const string_view words) { - return find(identifiers.cbegin(), identifiers.cend(), words) != identifiers.cend(); + return any_of(identifiers.cbegin(), identifiers.cend(), [&words](const auto& identifier) { + return words == identifier; + }); } #endif //YERBACON_RESERVEDIDENTIFIERS_HPP