Utils: Improve SmallStringView::operator==

Change-Id: I5be22e86cdeb7045386633733d2347f48a705578
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-08-03 12:10:49 +02:00
committed by Tim Jenssen
parent f6228cae22
commit 793acdb9c6

View File

@@ -137,10 +137,7 @@ private:
inline
bool operator==(const SmallStringView& first, const SmallStringView& second) noexcept
{
if (Q_LIKELY(first.size() != second.size()))
return false;
return !std::memcmp(first.data(), second.data(), first.size());
return first.size() == second.size() && std::memcmp(first.data(), second.data(), first.size()) == 0;
}
inline