Skip to content

Commit 1674670

Browse files
committed
fixed things
1 parent 5f89800 commit 1674670

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

v3.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ func (dec *V3Decoder) decodeValuev3(v v3.Value, e reflect.Value, yetToRead *uint
660660
if v, ok := k.([]byte); ok {
661661
m[string(v)] = key.Interface()
662662
} else {
663-
m[v] = key.Interface()
663+
m[k] = key.Interface()
664664
}
665665
}
666666
e.Set(reflect.ValueOf(m))
@@ -781,13 +781,13 @@ func (dec *V3Decoder) decodeValuev3(v v3.Value, e reflect.Value, yetToRead *uint
781781
shouldReplace := ValueKind == reflect.Array || ValueKind == reflect.Slice || ValueKind == reflect.Map
782782

783783
if !shouldReplace {
784-
value = reflect.New(e.Type().Elem()).Elem()
784+
value = reflect.New(reflect.TypeOf(arr).Elem()).Elem()
785785
}
786786
for i := 0; i < int(children); i++ {
787787
v.FromBytes(dec.in)
788788
*yetToRead += v.Childrenn - 1
789789
if shouldReplace {
790-
value = reflect.New(e.Type().Elem()).Elem()
790+
value = reflect.New(reflect.TypeOf(arr).Elem()).Elem()
791791
}
792792

793793
err = dec.decodeValuev3(v, value, yetToRead)

0 commit comments

Comments
 (0)