Skip to content

Commit b19d1a7

Browse files
authored
Add preprocessor macro GTL_DISABLE_MIX to disable hash mixing. (#29)
1 parent 2886f96 commit b19d1a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/gtl/phmap.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,11 @@ class raw_hash_set {
25202520
struct HashElement {
25212521
template<class K, class... Args>
25222522
size_t operator()(const K& key, Args&&...) const {
2523+
#if GTL_DISABLE_MIX
2524+
return h(key);
2525+
#else
25232526
return phmap_mix<sizeof(size_t)>()(static_cast<size_t>(h(key)));
2527+
#endif
25242528
}
25252529
const hasher& h;
25262530
};
@@ -4309,7 +4313,11 @@ class parallel_hash_set {
43094313
struct HashElement {
43104314
template<class K, class... Args>
43114315
size_t operator()(const K& key, Args&&...) const {
4316+
#if GTL_DISABLE_MIX
4317+
return h(key);
4318+
#else
43124319
return phmap_mix<sizeof(size_t)>()(h(key));
4320+
#endif
43134321
}
43144322
const hasher& h;
43154323
};

0 commit comments

Comments
 (0)