Skip to content

Commit d83b5b9

Browse files
author
Bruno de Queiroz
committed
fix: removing unnecessary code as the empty Children case is already covered by the fillRecursively
1 parent 4d23775 commit d83b5b9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

parser/element_fill.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,7 @@ func (f filler) setMap(field reflect.Value, node *Node) error {
325325

326326
if field.Type().Elem().Kind() == reflect.String {
327327
for _, child := range node.Children {
328-
if len(child.Children) > 0 {
329-
f.fillRecursively(child.Name, child, field)
330-
} else {
331-
field.SetMapIndex(reflect.ValueOf(child.Name), reflect.ValueOf(child.Value))
332-
}
328+
f.fillRecursively(child.Name, child, field)
333329
}
334330

335331
return nil

0 commit comments

Comments
 (0)