mirror of
https://github.com/helm/helm.git
synced 2026-04-20 21:56:55 -04:00
improved coalesce readability by getting rid of continue statements
Signed-off-by: Bernd Gutjahr <bernd.gutjahr@microfocus.com>
This commit is contained in:
parent
1740e7f89b
commit
5cf9735a9d
1 changed files with 5 additions and 7 deletions
|
|
@ -120,13 +120,11 @@ func coalesceGlobals(dest, src map[string]interface{}) {
|
|||
// top-down.
|
||||
CoalesceTables(vv, destvmap)
|
||||
dg[key] = vv
|
||||
continue
|
||||
}
|
||||
}
|
||||
} else if dv, ok := dg[key]; ok && istable(dv) {
|
||||
// It's not clear if this condition can actually ever trigger.
|
||||
log.Printf("key %s is table. Skipping", key)
|
||||
continue
|
||||
} else {
|
||||
// TODO: Do we need to do any additional checking on the value?
|
||||
dg[key] = val
|
||||
|
|
@ -159,15 +157,15 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}) {
|
|||
src, ok := val.(map[string]interface{})
|
||||
if !ok {
|
||||
// If the original value is nil, there is nothing to coalesce, so we don't print
|
||||
// the warning but simply continue
|
||||
// the warning
|
||||
if val != nil {
|
||||
log.Printf("warning: skipped value for %s: Not a table.", key)
|
||||
}
|
||||
continue
|
||||
} else {
|
||||
// Because v has higher precedence than nv, dest values override src
|
||||
// values.
|
||||
CoalesceTables(dest, src)
|
||||
}
|
||||
// Because v has higher precedence than nv, dest values override src
|
||||
// values.
|
||||
CoalesceTables(dest, src)
|
||||
}
|
||||
} else {
|
||||
// If the key is not in v, copy it from nv.
|
||||
|
|
|
|||
Loading…
Reference in a new issue