Support map keys for simple compare types

This commit is contained in:
gingerBill
2020-11-29 16:12:21 +00:00
parent 7fbc081119
commit 57f5976ac1
5 changed files with 26 additions and 7 deletions
+3 -1
View File
@@ -76,6 +76,7 @@ default_hash_ptr :: inline proc "contextless" (data: rawptr, size: int) -> uintp
return default_hash(transmute([]byte)(s));
}
@(private)
_default_hasher_const :: inline proc "contextless" (data: rawptr, seed: uintptr, $N: uint) -> uintptr {
h := u64(seed) + 0xcbf29ce484222325;
p := uintptr(data);
@@ -86,7 +87,8 @@ _default_hasher_const :: inline proc "contextless" (data: rawptr, seed: uintptr,
}
return uintptr(h);
}
_default_hasher_n :: inline proc "contextless" (data: rawptr, seed: uintptr, N: int) -> uintptr {
default_hasher_n :: inline proc "contextless" (data: rawptr, seed: uintptr, N: int) -> uintptr {
h := u64(seed) + 0xcbf29ce484222325;
p := uintptr(data);
for _ in 0..<N {