aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/cbor
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 21:37:35 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 21:37:35 +0100
commit399c3ab067d0bbacbf9732107b932d5bb910b67f (patch)
tree1dde731a905e97dd355829ff453551125a17c9a3 /core/encoding/cbor
parente7d37607ef9ce54a80d83230150874b71d628d6d (diff)
Reduce the size of `runtime.Type_Info`
Diffstat (limited to 'core/encoding/cbor')
-rw-r--r--core/encoding/cbor/marshal.odin6
-rw-r--r--core/encoding/cbor/unmarshal.odin2
2 files changed, 4 insertions, 4 deletions
diff --git a/core/encoding/cbor/marshal.odin b/core/encoding/cbor/marshal.odin
index 2cdf384c3..022e297e9 100644
--- a/core/encoding/cbor/marshal.odin
+++ b/core/encoding/cbor/marshal.odin
@@ -506,7 +506,7 @@ _marshal_into_encoder :: proc(e: Encoder, v: any, ti: ^runtime.Type_Info) -> (er
}
n: u64; {
- for _, i in info.names {
+ for _, i in info.names[:info.field_count] {
if field_name(info, i) != "-" {
n += 1
}
@@ -522,7 +522,7 @@ _marshal_into_encoder :: proc(e: Encoder, v: any, ti: ^runtime.Type_Info) -> (er
entries := make([dynamic]Name, 0, n, e.temp_allocator) or_return
defer delete(entries)
- for _, i in info.names {
+ for _, i in info.names[:info.field_count] {
fname := field_name(info, i)
if fname == "-" {
continue
@@ -540,7 +540,7 @@ _marshal_into_encoder :: proc(e: Encoder, v: any, ti: ^runtime.Type_Info) -> (er
marshal_entry(e, info, v, entry.name, entry.field) or_return
}
} else {
- for _, i in info.names {
+ for _, i in info.names[:info.field_count] {
fname := field_name(info, i)
if fname == "-" {
continue
diff --git a/core/encoding/cbor/unmarshal.odin b/core/encoding/cbor/unmarshal.odin
index 13350bb85..4da2d5a93 100644
--- a/core/encoding/cbor/unmarshal.odin
+++ b/core/encoding/cbor/unmarshal.odin
@@ -618,7 +618,7 @@ _unmarshal_map :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header,
#partial switch t in ti.variant {
case reflect.Type_Info_Struct:
- if t.is_raw_union {
+ if .raw_union in t.flags {
return _unsupported(v, hdr)
}