mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 07:43:13 +00:00
Change seed logic
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user