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
Notes: sideshowbarker 2024-07-19 04:30:27 +09:00
2 changed files with 3 additions and 4 deletions

View file

@ -32,7 +32,7 @@ namespace AK {
class FlyString {
public:
FlyString() {}
FlyString() { }
FlyString(const FlyString& other)
: m_impl(other.impl())
{
@ -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...);
}