Skip to content

Commit 5023fb8

Browse files
author
Dan Laine
committed
Merge remote-tracking branch 'upstream/dev' into merkledb-dynamic-root
2 parents 473a264 + 61deacc commit 5023fb8

File tree

4 files changed

+46
-209
lines changed

4 files changed

+46
-209
lines changed

codec/reflectcodec/struct_fielder.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ const (
1818

1919
// TagValue is the value the tag must have to be serialized.
2020
TagValue = "true"
21-
22-
// TagValue is the value the tag must have to be serialized, this variant
23-
// includes the nullable option
24-
TagWithNullableValue = "true,nullable"
2521
)
2622

2723
var _ StructFielder = (*structFielder)(nil)
2824

2925
type FieldDesc struct {
3026
Index int
3127
MaxSliceLen uint32
32-
Nullable bool
3328
}
3429

3530
// StructFielder handles discovery of serializable fields in a struct.
@@ -89,17 +84,10 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error)
8984
// any tag with the right value
9085
var (
9186
captureField bool
92-
nullable bool
9387
)
9488
for _, tag := range s.tags {
95-
switch field.Tag.Get(tag) {
96-
case TagValue:
97-
captureField = true
98-
case TagWithNullableValue:
89+
if field.Tag.Get(tag) == TagValue {
9990
captureField = true
100-
nullable = true
101-
}
102-
if captureField {
10391
break
10492
}
10593
}
@@ -121,7 +109,6 @@ func (s *structFielder) GetSerializedFields(t reflect.Type) ([]FieldDesc, error)
121109
serializedFields = append(serializedFields, FieldDesc{
122110
Index: i,
123111
MaxSliceLen: maxSliceLen,
124-
Nullable: nullable,
125112
})
126113
}
127114
s.serializedFieldIndices[t] = serializedFields // cache result

0 commit comments

Comments
 (0)