Change seed logic

This commit is contained in:
gingerBill
2025-12-21 17:13:59 +00:00
parent 998da2c2da
commit cb2f3aca8b

View File

@@ -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)
}