aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/reflect/reflect.odin8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/reflect/reflect.odin b/core/reflect/reflect.odin
index 378c50ff0..b39c6ac6b 100644
--- a/core/reflect/reflect.odin
+++ b/core/reflect/reflect.odin
@@ -2007,10 +2007,12 @@ equal :: proc(a, b: any, including_indirect_array_recursion := false, recursion_
@(require_results)
-default_map_hash_by_ptr :: proc(ptr: ^$T, seed: uintptr = runtime.INITIAL_HASH_SEED) -> uintptr where intrinsics.type_is_comparable(T) {
+default_map_hash_by_ptr :: proc(ptr: ^$T, seed: uintptr = 0) -> uintptr where intrinsics.type_is_comparable(T) {
assert(ptr != nil)
-
info := intrinsics.type_map_info(map[T]struct{})
- return info.key_hasher(ptr, seed)
+ h := u64(seed) + runtime.INITIAL_HASH_SEED
+ actual_seed := uintptr(h) | uintptr(uintptr(h) == 0)
+
+ return info.key_hasher(ptr, actual_seed)
} \ No newline at end of file