From 1ec75006864e8f96531685f34347939bb29eca16 Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Sat, 2 Nov 2024 19:20:32 -0400 Subject: [PATCH] Add preprocessor macro `GTL_DISABLE_MIX` to disable hash mixing. --- include/gtl/phmap.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/gtl/phmap.hpp b/include/gtl/phmap.hpp index 4b4f591..11612f5 100644 --- a/include/gtl/phmap.hpp +++ b/include/gtl/phmap.hpp @@ -2524,7 +2524,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; }; @@ -4313,7 +4317,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; };