forked from qt-creator/qt-creator
Utils: Improve SmallStringView::operator==
Change-Id: I5be22e86cdeb7045386633733d2347f48a705578 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -137,10 +137,7 @@ private:
|
|||||||
inline
|
inline
|
||||||
bool operator==(const SmallStringView& first, const SmallStringView& second) noexcept
|
bool operator==(const SmallStringView& first, const SmallStringView& second) noexcept
|
||||||
{
|
{
|
||||||
if (Q_LIKELY(first.size() != second.size()))
|
return first.size() == second.size() && std::memcmp(first.data(), second.data(), first.size()) == 0;
|
||||||
return false;
|
|
||||||
|
|
||||||
return !std::memcmp(first.data(), second.data(), first.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
|||||||
Reference in New Issue
Block a user