diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-24 12:05:43 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-24 12:05:43 +0000 |
| commit | 450a602230598a35bd2a39a9ce744ff2114df463 (patch) | |
| tree | 8334889733c34ed0aecc1cea0c39de4b9c1fbf42 /core/encoding/json | |
| parent | 36764779cff8b36512ccf6068579ea7bde87279a (diff) | |
Fix json.marshal for `map[string]string`
Diffstat (limited to 'core/encoding/json')
| -rw-r--r-- | core/encoding/json/marshal.odin | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 1dadc8ef0..1eb75d36a 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -262,10 +262,14 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err: } map_cap := uintptr(runtime.map_cap(m^)) ks, vs, hs, _, _ := runtime.map_kvh_data_dynamic(m^, info.map_info) + + i := 0 for bucket_index in 0..<map_cap { if !runtime.map_hash_is_valid(hs[bucket_index]) { continue } + opt_write_iteration(w, opt, i) or_return + i += 1 key := rawptr(runtime.map_cell_index_dynamic(ks, info.map_info.ks, bucket_index)) value := rawptr(runtime.map_cell_index_dynamic(vs, info.map_info.vs, bucket_index)) |