Skip to content

Commit

Permalink
Issue ostafen#51:
Browse files Browse the repository at this point in the history
- removing the `continue` from the for loop.
  • Loading branch information
DaniloMarques1 committed Jun 5, 2022
1 parent e80aa4e commit b9df5c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions document.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (doc *Document) Copy() *Document {
}
}

// force tells that if we did not finding anything we should create
func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[string]interface{}, interface{}, string) {
fields := strings.Split(name, ".")

Expand Down Expand Up @@ -76,7 +77,7 @@ func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[
s, isSlice := f.([]interface{})
if isSlice {
if i < end-1 {
v, increment := lookupSliceField(fields[i+1:], 2, s)
v, increment := lookupSliceField(fields[i+1:], 1, s)
if v == nil {
return nil, nil, ""
} else if m, isMap := v.(map[string]interface{}); isMap {
Expand All @@ -86,7 +87,6 @@ func lookupField(name string, fieldMap map[string]interface{}, force bool) (map[
}

i += increment
continue
}
} else if i < end-1 {
currMap = m
Expand Down

0 comments on commit b9df5c5

Please sign in to comment.