From b19d1a7807c3f0b30278aa42af35d8a92f7ae515 Mon Sep 17 00:00:00 2001 From: Gregory Popovitch Date: Sat, 2 Nov 2024 19:25:47 -0400 Subject: [PATCH] Add preprocessor macro `GTL_DISABLE_MIX` to disable hash mixing. (#29) --- include/gtl/phmap.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/gtl/phmap.hpp b/include/gtl/phmap.hpp index a72badb..649dab0 100644 --- a/include/gtl/phmap.hpp +++ b/include/gtl/phmap.hpp @@ -2520,7 +2520,11 @@ class raw_hash_set { struct HashElement { template size_t operator()(const K& key, Args&&...) const { +#if GTL_DISABLE_MIX + return h(key); +#else return phmap_mix()(static_cast(h(key))); +#endif } const hasher& h; }; @@ -4309,7 +4313,11 @@ class parallel_hash_set { struct HashElement { template size_t operator()(const K& key, Args&&...) const { +#if GTL_DISABLE_MIX + return h(key); +#else return phmap_mix()(h(key)); +#endif } const hasher& h; };