Skip to content

Commit

Permalink
fixed things
Browse files Browse the repository at this point in the history
  • Loading branch information
JAicewizard committed May 23, 2020
1 parent 5f89800 commit 1674670
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ func (dec *V3Decoder) decodeValuev3(v v3.Value, e reflect.Value, yetToRead *uint
if v, ok := k.([]byte); ok {
m[string(v)] = key.Interface()
} else {
m[v] = key.Interface()
m[k] = key.Interface()
}
}
e.Set(reflect.ValueOf(m))
Expand Down Expand Up @@ -781,13 +781,13 @@ func (dec *V3Decoder) decodeValuev3(v v3.Value, e reflect.Value, yetToRead *uint
shouldReplace := ValueKind == reflect.Array || ValueKind == reflect.Slice || ValueKind == reflect.Map

if !shouldReplace {
value = reflect.New(e.Type().Elem()).Elem()
value = reflect.New(reflect.TypeOf(arr).Elem()).Elem()
}
for i := 0; i < int(children); i++ {
v.FromBytes(dec.in)
*yetToRead += v.Childrenn - 1
if shouldReplace {
value = reflect.New(e.Type().Elem()).Elem()
value = reflect.New(reflect.TypeOf(arr).Elem()).Elem()
}

err = dec.decodeValuev3(v, value, yetToRead)
Expand Down

0 comments on commit 1674670

Please sign in to comment.