Skip to content

Commit

Permalink
Re-use node variable
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
  • Loading branch information
jszwedko committed Jun 18, 2022
1 parent ee07560 commit 72dc91d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions altsrc/map_input_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 72dc91d

Please sign in to comment.