Speed up GUID equality comparison.

This commit is contained in:
John Ralls 2018-03-06 09:48:22 -08:00
parent d95eb0f7f3
commit 36d729652b
2 changed files with 2 additions and 3 deletions

View File

@ -412,9 +412,7 @@ GUID::operator < (GUID const & other) noexcept
bool operator == (GUID const & lhs, GncGUID const & rhs) noexcept
{
auto ret = std::mismatch (lhs.begin (), lhs.end (), rhs.reserved);
return ret.first == lhs.end ();
return lhs.implementation == GUID(rhs).implementation;
}
bool

View File

@ -55,6 +55,7 @@ struct GUID
auto begin () const noexcept -> decltype (implementation.begin ());
auto end () const noexcept -> decltype (implementation.end ());
bool operator < (GUID const &) noexcept;
friend bool operator == (GUID const &, GncGUID const &) noexcept;
friend bool operator != (GUID const &, GUID const &) noexcept;
};