mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-30 15:41:12 +00:00
ugh todo: seed per ht, not per hash
This commit is contained in:
parent
2e57a952a7
commit
f1a662a422
1 changed files with 1 additions and 1 deletions
2
util.c
2
util.c
|
@ -615,7 +615,7 @@ GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, size_t
|
||||||
/* we use the crc table as seeds for the murmur hash :P */
|
/* we use the crc table as seeds for the murmur hash :P */
|
||||||
size_t util_hthash(hash_table_t *ht, const char *key) {
|
size_t util_hthash(hash_table_t *ht, const char *key) {
|
||||||
static size_t seed = 0;
|
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 */
|
/* reset seed */
|
||||||
if (seed >= sizeof(util_crc32_table) / sizeof(*util_crc32_table))
|
if (seed >= sizeof(util_crc32_table) / sizeof(*util_crc32_table))
|
||||||
|
|
Loading…
Reference in a new issue