From afe1ded1ae843482a2626f4bbc264478c9421ee2 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 9 Jul 2020 14:46:23 -0400 Subject: [PATCH] Improve subtable selection in parallel_* maps by using higher bits of the key, as suggested by @fowles - issue #53 --- parallel_hashmap/phmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 1635172..bacdeea 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -3215,7 +3215,7 @@ protected: } static size_t subidx(size_t hashval) { - return (hashval ^ (hashval >> N)) & mask; + return ((hashval >> 8) ^ (hashval >> 16) ^ (hashval >> 24)) & mask; } template