Re-use node variable

Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
This commit is contained in:
Jesse Szwedko 2022-06-18 13:38:22 -07:00
parent ee0756044c
commit 72dc91db74
No known key found for this signature in database
GPG Key ID: 02B8F767A3B23EEC

View File

@ -35,11 +35,10 @@ func nestedVal(name string, tree map[interface{}]interface{}) (interface{}, bool
switch child := child.(type) {
case map[string]interface{}:
m := make(map[interface{}]interface{}, len(child))
node = make(map[interface{}]interface{}, len(child))
for k, v := range child {
m[k] = v
node[k] = v
}
node = m
case map[interface{}]interface{}:
node = child
default: