]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix murmur hash seeding
authorDale Weiler <killfieldengine@gmail.com>
Thu, 20 Dec 2012 08:46:39 +0000 (08:46 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 20 Dec 2012 08:46:39 +0000 (08:46 +0000)
util.c

diff --git a/util.c b/util.c
index 3961c74f81d996d3b28e41641fcbc2a3be57b376..d1eb5b43754052448cb655dcfa57ae82ba72aa6c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -615,7 +615,7 @@ static GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key,
 /* we use the crc table as seeds for the murmur hash :P */
 size_t util_hthash(hash_table_t *ht, const char *key) {
     static   size_t seed = 0;
 /* we use the crc table as seeds for the murmur hash :P */
 size_t util_hthash(hash_table_t *ht, const char *key) {
     static   size_t seed = 0;
-    register size_t hash = util_hthashfunc(ht, key, util_crc32_table[seed]);
+    register size_t hash = util_hthashfunc(ht, key, util_crc32_table[seed++]);
 
     /* reset seed */
     if (seed >= sizeof(util_crc32_table) / sizeof(*util_crc32_table))
 
     /* reset seed */
     if (seed >= sizeof(util_crc32_table) / sizeof(*util_crc32_table))