From 162b422e486b4741782102e38a79d8350b8e7210 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 20 Feb 2018 12:35:22 +0100 Subject: [PATCH] Better distribution for hash values in ClosedHashTable --- libsrc/general/hashtabl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/general/hashtabl.hpp b/libsrc/general/hashtabl.hpp index 2ff83821..d8ee3182 100644 --- a/libsrc/general/hashtabl.hpp +++ b/libsrc/general/hashtabl.hpp @@ -1344,7 +1344,7 @@ PrintMemInfo (ostream & ost) const inline void SetInvalid (INDEX & i) { i = -1; } inline bool IsInvalid (INDEX i) { return i == -1; } -inline size_t HashValue (INDEX i, size_t size) { return size_t(i) % size; } +inline size_t HashValue (INDEX i, size_t size) { return (113*size_t(i)) % size; } inline void SetInvalid (INDEX_2 & i2) { i2[0] = -1; } inline bool IsInvalid (INDEX_2 i2) { return i2[0] == -1; }