From 15155d017226ae5af4703fb735caaffc63f5b2fc Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 24 Dec 2017 17:21:10 +0000 Subject: [PATCH] refactor: lift some code out of inner loop --- render/detailed/parents.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/render/detailed/parents.go b/render/detailed/parents.go index 80913d7bcb..2a5bcc1a96 100644 --- a/render/detailed/parents.go +++ b/render/detailed/parents.go @@ -39,6 +39,10 @@ func Parents(r report.Report, n report.Node) []Parent { if !ok { continue } + apiTopologyID, ok := primaryAPITopology[topologyID] + if !ok { + continue + } parents, _ := n.Parents.Lookup(topologyID) for _, id := range parents { if topologyID == n.Topology && id == n.ID { @@ -48,10 +52,6 @@ func Parents(r report.Report, n report.Node) []Parent { if !ok { parentNode = report.MakeNode(id).WithTopology(topologyID) } - apiTopologyID, ok := primaryAPITopology[topologyID] - if !ok { - continue - } if summary, ok := MakeBasicNodeSummary(r, parentNode); ok { result = append(result, Parent{ ID: summary.ID,