|
@@ -417,14 +417,13 @@ func (d *decoder) mapping(n *node, out reflect.Value) (good bool) {
|
|
|
if out.Kind() != reflect.Map {
|
|
if out.Kind() != reflect.Map {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
- if out.IsNil() {
|
|
|
|
|
- out.Set(reflect.MakeMap(out.Type()))
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
outt := out.Type()
|
|
outt := out.Type()
|
|
|
kt := outt.Key()
|
|
kt := outt.Key()
|
|
|
et := outt.Elem()
|
|
et := outt.Elem()
|
|
|
|
|
|
|
|
|
|
+ if out.IsNil() {
|
|
|
|
|
+ out.Set(reflect.MakeMap(outt))
|
|
|
|
|
+ }
|
|
|
l := len(n.children)
|
|
l := len(n.children)
|
|
|
for i := 0; i < l; i += 2 {
|
|
for i := 0; i < l; i += 2 {
|
|
|
k := reflect.New(kt).Elem()
|
|
k := reflect.New(kt).Elem()
|