@@ -91,7 +91,6 @@ func {%s= goName %}ReadJSONLegacy(legacyTypeNames bool, j interface{}, vec *{%s=
9191{%- endif -%}
9292func {%s= goName %}ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer, vec *{%s= typeString %} {%s= valueNatArgsDecl %}) error {
9393 *vec = (*vec)[:cap(*vec)]
94- arr := *vec
9594 index := 0
9695 if in != nil {
9796 in.Delim('{')
@@ -104,9 +103,9 @@ func {%s= goName %}ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer, vec *{%
104103 *vec = append(*vec, newValue)
105104 *vec = (*vec)[:cap(*vec)]
106105 }
107- arr [index].Key = append(arr [index].Key[:0], in.UnsafeFieldName(true)...)
106+ (*vec) [index].Key = append((*vec) [index].Key[:0], in.UnsafeFieldName(true)...)
108107 in.WantColon()
109- {%s= tuple.dictValueField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "in", "arr [index]."+valueFieldName, formatNatArgs(nil, tuple.dictValueField.natArgs), false ) %}
108+ {%s= tuple.dictValueField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "in", "(*vec) [index]."+valueFieldName, formatNatArgs(nil, tuple.dictValueField.natArgs), false ) %}
110109 in.WantComma()
111110 }
112111 in.Delim('}')
@@ -165,7 +164,6 @@ func {%s= goName %}ReadJSONLegacy(legacyTypeNames bool, j interface{}, vec *{%s=
165164{%- endif -%}
166165func {%s= goName %}ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer, vec *{%s= typeString %} {%s= valueNatArgsDecl %}) error {
167166 *vec = (*vec)[:cap(*vec)]
168- arr := *vec
169167 index := 0
170168 if in != nil {
171169 in.Delim('{')
@@ -183,9 +181,9 @@ func {%s= goName %}ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer, vec *{%
183181 return {%s= tuple.wr.gen.InternalPrefix()%}ErrorInvalidJSON({%q= typeString %}, "expected correct json value in key")
184182 }
185183 in2 := basictl.JsonLexer{Data: keyBytes}
186- {%s= tuple.dictKeyField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "&in2", "arr [index]."+keyFieldName, formatNatArgs(nil, tuple.dictKeyField.natArgs), false ) %}
184+ {%s= tuple.dictKeyField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "&in2", "(*vec) [index]."+keyFieldName, formatNatArgs(nil, tuple.dictKeyField.natArgs), false ) %}
187185 in.WantColon()
188- {%s= tuple.dictValueField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "in", "arr [index]."+valueFieldName, formatNatArgs(nil, tuple.dictValueField.natArgs), false ) %}
186+ {%s= tuple.dictValueField.t.TypeJSON2ReadingCode(bytesVersion, directImports, tuple.wr.ins, "in", "(*vec) [index]."+valueFieldName, formatNatArgs(nil, tuple.dictValueField.natArgs), false ) %}
189187 in.WantComma()
190188 }
191189 in.Delim('}')
0 commit comments