Optimize uint's operator== and operator!= to not do byte-by-byte compares.

This commit is contained in:
JoelKatz
2013-01-08 16:16:35 -08:00
parent aeb7a2af5d
commit c43f6a54dc

View File

@@ -206,12 +206,12 @@ public:
friend inline bool operator==(const base_uint& a, const base_uint& b)
{
return !compare(a, b);
return memcmp(a.pn, b.pn, sizeof(a.pn)) == 0;
}
friend inline bool operator!=(const base_uint& a, const base_uint& b)
{
return !!compare(a, b);
return memcmp(a.pn, b.pn, sizeof(a.pn)) != 0;
}
std::string GetHex() const