ReservedIdentifiers.hpp: Use std::any_of instead of std::find in the reserved function

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2023-04-01 21:21:09 +02:00
parent 375f10acb3
commit b6a708dcc0
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 1 deletions

View File

@ -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