mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 14:42:24 +01:00
Fix hash implementation for SerializedBlockCache
This commit is contained in:
parent
e16a470d59
commit
5daafc9d33
@ -425,11 +425,10 @@ private:
|
|||||||
std::unordered_set<session_t> waiting_players;
|
std::unordered_set<session_t> 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 {
|
struct SBCHash {
|
||||||
size_t operator() (const std::pair<v3s16, u16> &p) const {
|
size_t operator() (const std::pair<v3s16, u16> &p) const {
|
||||||
return (((size_t) p.first.X) << 48) | (((size_t) p.first.Y) << 32) |
|
return std::hash<v3s16>()(p.first) ^ p.second;
|
||||||
(((size_t) p.first.Z) << 16) | ((size_t) p.second);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user