QUtf8StringView: Check size directly in operator==
We can avoid the non-inlined function call if the sizes do not match up. This aligns the implementation of QUtf8StringView's operator== with the one used for the other string classes. Change-Id: Iaaf71b236edc0385551639961f753f11b324b327 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
58437836f0
commit
52e0a91fbc
@ -322,7 +322,8 @@ private:
|
|||||||
|
|
||||||
[[nodiscard]] friend inline bool operator==(QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
|
[[nodiscard]] friend inline bool operator==(QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
|
||||||
{
|
{
|
||||||
return QtPrivate::equalStrings(QBasicUtf8StringView<false>(lhs.data(), lhs.size()),
|
return lhs.size() == rhs.size() &&
|
||||||
|
QtPrivate::equalStrings(QBasicUtf8StringView<false>(lhs.data(), lhs.size()),
|
||||||
QBasicUtf8StringView<false>(rhs.data(), rhs.size()));
|
QBasicUtf8StringView<false>(rhs.data(), rhs.size()));
|
||||||
}
|
}
|
||||||
[[nodiscard]] friend inline bool operator!=(QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
|
[[nodiscard]] friend inline bool operator!=(QBasicUtf8StringView lhs, QBasicUtf8StringView rhs) noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user