Skip to content

Commit

Permalink
Fix errors in operator<, operator> of Utf8String, Utf16String (#1114)
Browse files Browse the repository at this point in the history
  • Loading branch information
xezon authored Feb 15, 2024
1 parent 3caa927 commit c0efefe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/game/common/system/asciistring.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,18 @@ class Utf8String
friend bool operator==(Utf8String const &left, Utf8String const &right) { return left.Compare(right) == 0; }
friend bool operator==(Utf8String const &left, const char *right) { return left.Compare(right) == 0; }
friend bool operator==(const char *left, Utf8String const &right) { return right.Compare(left) == 0; }

friend bool operator!=(Utf8String const &left, Utf8String const &right) { return left.Compare(right) != 0; }
friend bool operator!=(Utf8String const &left, const char *right) { return left.Compare(right) != 0; }
friend bool operator!=(const char *left, Utf8String const &right) { return right.Compare(left) != 0; }

friend bool operator<(Utf8String const &left, Utf8String const &right) { return left.Compare(right) < 0; }
friend bool operator<(Utf8String const &left, const char *right) { return left.Compare(right) < 0; }
friend bool operator<(const char *left, Utf8String const &right) { return right.Compare(left) >= 0; }
friend bool operator<(const char *left, Utf8String const &right) { return !(right.Compare(left) < 0); }

friend bool operator>(Utf8String const &left, Utf8String const &right) { return left.Compare(right) > 0; }
friend bool operator>(Utf8String const &left, const char *right) { return left.Compare(right) < 0; }
friend bool operator>(const char *left, Utf8String const &right) { return right.Compare(left) >= 0; }
friend bool operator>(Utf8String const &left, const char *right) { return left.Compare(right) > 0; }
friend bool operator>(const char *left, Utf8String const &right) { return !(right.Compare(left) > 0); }

friend Utf8String operator+(const Utf8String &a, const Utf8String &b)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/common/system/unicodestring.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ class Utf16String

friend bool operator<(Utf16String const &left, Utf16String const &right) { return left.Compare(right) < 0; }
friend bool operator<(Utf16String const &left, const unichar_t *right) { return left.Compare(right) < 0; }
friend bool operator<(const unichar_t *left, Utf16String const &right) { return right.Compare(left) < 0; }
friend bool operator<(const unichar_t *left, Utf16String const &right) { return !(right.Compare(left) < 0); }

friend bool operator>(Utf16String const &left, Utf16String const &right) { return left.Compare(right) > 0; }
friend bool operator>(Utf16String const &left, const unichar_t *right) { return left.Compare(right) > 0; }
friend bool operator>(const unichar_t *left, Utf16String const &right) { return right.Compare(left) > 0; }
friend bool operator>(const unichar_t *left, Utf16String const &right) { return !(right.Compare(left) > 0); }

public:
static Utf16String const s_emptyString;
Expand Down

0 comments on commit c0efefe

Please sign in to comment.