aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-21 17:13:59 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-12-21 17:13:59 +0000
commitcb2f3aca8b63ca59f63cf794c767096860990f6e (patch)
treed17682231f0a8bf8fc43f3d8410e3cf66d3cec8c /core
parent998da2c2da72853cff9ceeb86d07ad20bb81a8c6 (diff)
Change seed logic
Diffstat (limited to 'core')
-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