1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:07:36 +00:00

AK: Tweak String::is_one_of() and FlyString::is_one_of()

Switch the comparisons from "other == *this" to "*this == other".
This commit is contained in:
Andreas Kling 2020-07-28 17:40:23 +02:00
parent 8b55d3d86e
commit ebd2e7d9f5
2 changed files with 3 additions and 4 deletions

View file

@ -93,12 +93,11 @@ public:
template<typename T, typename... Rest>
bool is_one_of(const T& string, Rest... rest) const
{
if (string == *this)
if (*this == string)
return true;
return is_one_of(rest...);
}
private:
bool is_one_of() const { return false; }

View file

@ -230,7 +230,7 @@ public:
template<typename T, typename... Rest>
bool is_one_of(const T& string, Rest... rest) const
{
if (string == *this)
if (*this == string)
return true;
return is_one_of(rest...);
}