mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 19:02:13 +00:00
Fix map_insert
This commit is contained in:
@@ -672,10 +672,10 @@ shrink_dynamic_array :: proc(array: ^$T/[dynamic]$E, new_cap := -1, loc := #call
|
||||
@builtin
|
||||
map_insert :: proc(m: ^$T/map[$K]$V, key: K, value: V, loc := #caller_location) -> (ptr: ^V) {
|
||||
key, value := key, value
|
||||
h := __get_map_header(m)
|
||||
h := __get_map_header(T)
|
||||
|
||||
data := uintptr(__dynamic_map_set(h, __get_map_key_hash(&key), &key, &value, loc))
|
||||
return (^V)(data + h.value_offset)
|
||||
e := __dynamic_map_set(m, h, __get_map_key_hash(&key), &key, &value, loc)
|
||||
return (^V)(uintptr(e) + h.value_offset)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user