Skip to content

Commit

Permalink
refactor: remove redundant code in MergeMap
Browse files Browse the repository at this point in the history
remove the redundant code that overwrite duplicate keys in MergeMap
function because this part of the code will be executed in mergeModifier
function
  • Loading branch information
huydinhle authored and Charles546 committed Feb 10, 2020
1 parent 64bd0f1 commit ade16d7
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/dipper/mapUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,6 @@ func mergeModifier(dst map[string]interface{}) {
// MergeMap : merge the data from source to destination with some overriding rule
func MergeMap(dst map[string]interface{}, src interface{}) map[string]interface{} {
dst = CombineMap(dst, src)
for k, v := range dst {
if k[len(k)-1] == '-' {
if ev, ok := dst[k[:len(k)-1]]; !ok || ev == nil {
dst[k[:len(k)-1]] = v
}
delete(dst, k)
}
}

mergeModifier(dst)

Expand Down

0 comments on commit ade16d7

Please sign in to comment.