QString: use equalStrings in operator== and operator!=

QStringView already did since 6.0. I don't know how we missed this.

Pick-to: 6.5 6.6
Change-Id: I5acc02341c5940499682fffd1774f7c3a807317a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Thiago Macieira 2023-07-24 18:22:59 -07:00
parent 02a98a5646
commit 3c4c7860f0

View File

@ -692,7 +692,7 @@ public:
static QString number(double, char format='g', int precision=6);
friend bool operator==(const QString &s1, const QString &s2) noexcept
{ return (s1.size() == s2.size()) && QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive) == 0; }
{ return (s1.size() == s2.size()) && QtPrivate::equalStrings(s1, s2); }
friend bool operator< (const QString &s1, const QString &s2) noexcept
{ return QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive) < 0; }
friend bool operator> (const QString &s1, const QString &s2) noexcept { return s2 < s1; }
@ -701,7 +701,7 @@ public:
friend bool operator>=(const QString &s1, const QString &s2) noexcept { return !(s1 < s2); }
friend bool operator==(const QString &s1, QLatin1StringView s2) noexcept
{ return (s1.size() == s2.size()) && QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive) == 0; }
{ return (s1.size() == s2.size()) && QtPrivate::equalStrings(s1, s2); }
friend bool operator< (const QString &s1, QLatin1StringView s2) noexcept
{ return QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive) < 0; }
friend bool operator> (const QString &s1, QLatin1StringView s2) noexcept