diff options
| author | gingerBill <bill@gingerbill.org> | 2023-09-30 15:34:39 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-09-30 15:34:39 +0100 |
| commit | 14adcb9db89f4a668210a56d909cdca96088aae2 (patch) | |
| tree | 3f11a5d5ca0dd638387abc60e6cc50a8e1604d0c /core/encoding/json | |
| parent | 41a22bd83d9458249a60a9d1415f4862f1593b76 (diff) | |
Use `or_break` and `or_continue` where appropriate in the core library
Diffstat (limited to 'core/encoding/json')
| -rw-r--r-- | core/encoding/json/marshal.odin | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 43f464bdb..85eca50b6 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -265,9 +265,8 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err: i := 0 for bucket_index in 0..<map_cap { - if !runtime.map_hash_is_valid(hs[bucket_index]) { - continue - } + runtime.map_hash_is_valid(hs[bucket_index]) or_continue + opt_write_iteration(w, opt, i) or_return i += 1 @@ -284,8 +283,8 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err: #partial switch info in ti.variant { case runtime.Type_Info_String: switch s in a { - case string: name = s - case cstring: name = string(s) + case string: name = s + case cstring: name = string(s) } opt_write_key(w, opt, name) or_return |