From cb2f3aca8b63ca59f63cf794c767096860990f6e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 21 Dec 2025 17:13:59 +0000 Subject: Change seed logic --- core/reflect/reflect.odin | 8 +++++--- 1 file 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 -- cgit v1.2.3