From 5daafc9d336d3f946854874e56a38ae9ac130811 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 22 May 2022 00:37:58 +0200 Subject: Fix hash implementation for SerializedBlockCache --- src/server.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 2c21f5dfc..71f692e87 100644 --- a/src/server.h +++ b/src/server.h @@ -425,11 +425,10 @@ private: std::unordered_set waiting_players; }; - // the standard library does not implement std::hash for pairs so we have this: + // The standard library does not implement std::hash for pairs so we have this: struct SBCHash { size_t operator() (const std::pair &p) const { - return (((size_t) p.first.X) << 48) | (((size_t) p.first.Y) << 32) | - (((size_t) p.first.Z) << 16) | ((size_t) p.second); + return std::hash()(p.first) ^ p.second; } }; -- cgit v1.2.3