diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-11 12:01:40 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-11 12:01:40 +0100 |
| commit | b2fdb69b4dd7f52f42414139a257b3800eb51a90 (patch) | |
| tree | 5edf1abb568eb59c6c7da9ae25422e4804531a31 /src/map.cpp | |
| parent | af2736daec0e6579a006bd8d4567c977c8e56c45 (diff) | |
Named procedure calls
Diffstat (limited to 'src/map.cpp')
| -rw-r--r-- | src/map.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp index d45d2bccb..57942365a 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -19,6 +19,7 @@ enum HashKeyKind { struct HashKey { HashKeyKind kind; + // u128 key; u64 key; union { String string; // if String, s.len > 0 @@ -29,9 +30,8 @@ struct HashKey { gb_inline HashKey hashing_proc(void const *data, isize len) { HashKey h = {HashKey_Default}; h.kind = HashKey_Default; - // h.key = gb_murmur64(data, len); + // h.key = u128_from_u64(gb_fnv64a(data, len)); h.key = gb_fnv64a(data, len); - // h.key = MurmurHash3_128(data, len, 0x3803cb8e); return h; } @@ -136,7 +136,8 @@ template <typename T> gb_internal MapFindResult map__find(Map<T> *h, HashKey key) { MapFindResult fr = {-1, -1, -1}; if (h->hashes.count > 0) { - fr.hash_index = key.key % h->hashes.count; + // fr.hash_index = u128_to_i64(key.key % u128_from_i64(h->hashes.count)); + fr.hash_index = key.key % h->hashes.count; fr.entry_index = h->hashes[fr.hash_index]; while (fr.entry_index >= 0) { if (hash_key_equal(h->entries[fr.entry_index].key, key)) { |