Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
urso committed May 4, 2020
1 parent 28966fe commit ffdb1ce
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libbeat/common/mapstr.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ func (m MapStr) deepUpdateMap(d MapStr, overwrite bool) {
}

func deepUpdateValue(old interface{}, val MapStr, overwrite bool) interface{} {
if old == nil {
return val
}

switch sub := old.(type) {
case MapStr:
if sub == nil {
Expand All @@ -117,7 +113,9 @@ func deepUpdateValue(old interface{}, val MapStr, overwrite bool) interface{} {
tmp.deepUpdateMap(val, overwrite)
return tmp
default:
// This should never happen
// We reach the default branch if old is no map or if old == nil.
// In either case we return `val`, such that the old value is completely
// replaced when merging.
return val
}
}
Expand Down

0 comments on commit ffdb1ce

Please sign in to comment.