aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/iohash.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/iohash.h b/src/zencore/include/zencore/iohash.h
index c70e98e47..ff902399e 100644
--- a/src/zencore/include/zencore/iohash.h
+++ b/src/zencore/include/zencore/iohash.h
@@ -61,7 +61,20 @@ struct IoHash
static const IoHash Zero; // Initialized to all zeros
inline auto operator<=>(const IoHash& rhs) const = default;
- inline bool operator==(const IoHash& rhs) const { return memcmp(Hash, rhs.Hash, sizeof Hash) == 0; }
+ inline bool operator==(const IoHash& rhs) const
+ {
+ const uint32_t* LhsHash = reinterpret_cast<const uint32_t*>(Hash);
+ const uint32_t* RhsHash = reinterpret_cast<const uint32_t*>(rhs.Hash);
+ return LhsHash[0] == RhsHash[0] && LhsHash[1] == RhsHash[1] && LhsHash[2] == RhsHash[2] && LhsHash[3] == RhsHash[3] &&
+ LhsHash[4] == RhsHash[4];
+ }
+ inline bool operator!=(const IoHash& rhs) const
+ {
+ const uint32_t* LhsHash = reinterpret_cast<const uint32_t*>(Hash);
+ const uint32_t* RhsHash = reinterpret_cast<const uint32_t*>(rhs.Hash);
+ return LhsHash[0] != RhsHash[0] || LhsHash[1] != RhsHash[1] || LhsHash[2] != RhsHash[2] || LhsHash[3] != RhsHash[3] ||
+ LhsHash[4] != RhsHash[4];
+ }
inline bool operator<(const IoHash& rhs) const { return memcmp(Hash, rhs.Hash, sizeof Hash) < 0; }
struct Hasher