refactor: don't set shape based on unitialised topology

This doesn't make any difference to the outcome - we were simply
setting the shape in the NodeSummary to "", which is what it starts
out as - but looks less weird in the code.
This commit is contained in:
Matthias Radestock
2017-12-22 02:28:14 +00:00
parent bd214227dc
commit b8eeadda34

View File

@@ -348,12 +348,12 @@ func groupNodeSummary(base NodeSummary, r report.Report, n report.Node) (NodeSum
}
base.Label, base.Rank = label, label
t, ok := r.Topology(parts[1])
if ok && t.Label != "" {
base.LabelMinor = pluralize(n.Counters, parts[1], t.Label, t.LabelPlural)
if t, ok := r.Topology(parts[1]); ok {
base.Shape = t.GetShape()
if t.Label != "" {
base.LabelMinor = pluralize(n.Counters, parts[1], t.Label, t.LabelPlural)
}
}
base.Shape = t.GetShape()
base.Stack = true
return base, true
}