mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Improve COutPoint less operator
This commit is contained in:
parent
f034bced26
commit
0f176927f8
@ -34,7 +34,8 @@ public:
|
|||||||
|
|
||||||
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
||||||
{
|
{
|
||||||
return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n));
|
int cmp = a.hash.Compare(b.hash);
|
||||||
|
return cmp < 0 || (cmp == 0 && a.n < b.n);
|
||||||
}
|
}
|
||||||
|
|
||||||
friend bool operator==(const COutPoint& a, const COutPoint& b)
|
friend bool operator==(const COutPoint& a, const COutPoint& b)
|
||||||
|
@ -42,9 +42,11 @@ public:
|
|||||||
memset(data, 0, sizeof(data));
|
memset(data, 0, sizeof(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
friend inline bool operator==(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) == 0; }
|
inline int Compare(const base_blob& other) const { return memcmp(data, other.data, sizeof(data)); }
|
||||||
friend inline bool operator!=(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) != 0; }
|
|
||||||
friend inline bool operator<(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) < 0; }
|
friend inline bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }
|
||||||
|
friend inline bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }
|
||||||
|
friend inline bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
|
||||||
|
|
||||||
std::string GetHex() const;
|
std::string GetHex() const;
|
||||||
void SetHex(const char* psz);
|
void SetHex(const char* psz);
|
||||||
|
Loading…
Reference in New Issue
Block a user