mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Speed up GUID equality comparison.
This commit is contained in:
parent
d95eb0f7f3
commit
36d729652b
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user