mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
Update json/unmarshal.odin for the new runtime.__dynamic_map_set
This commit is contained in:
@@ -422,19 +422,17 @@ unmarshal_object :: proc(p: ^Parser, v: any, end_token: Token_Kind) -> (err: Unm
|
||||
delete(key, p.allocator)
|
||||
return err
|
||||
}
|
||||
|
||||
hash := runtime.Map_Hash {
|
||||
hash = runtime.default_hasher_string(&key, 0),
|
||||
key_ptr = &key,
|
||||
}
|
||||
|
||||
|
||||
key_hash := runtime.default_hasher_string(&key, 0)
|
||||
key_ptr := rawptr(&key)
|
||||
|
||||
key_cstr: cstring
|
||||
if reflect.is_cstring(t.key) {
|
||||
key_cstr = cstring(raw_data(key))
|
||||
hash.key_ptr = &key_cstr
|
||||
key_ptr = &key_cstr
|
||||
}
|
||||
|
||||
set_ptr := runtime.__dynamic_map_set(header, hash, map_backing_value.data)
|
||||
set_ptr := runtime.__dynamic_map_set(header, key_hash, key_ptr, map_backing_value.data)
|
||||
if set_ptr == nil {
|
||||
delete(key, p.allocator)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user