From: sfan5 Date: Sat, 21 May 2022 22:37:58 +0000 (+0200) Subject: Fix hash implementation for SerializedBlockCache X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=5daafc9d336d3f946854874e56a38ae9ac130811;p=dragonfireclient.git Fix hash implementation for SerializedBlockCache --- 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 @@ class Server : public con::PeerHandler, public MapEventReceiver, 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; } };