Skip to content

Commit

Permalink
refactor: lift some code out of inner loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rade committed Dec 25, 2017
1 parent b47c646 commit e7b8d35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions render/detailed/parents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit e7b8d35

Please sign in to comment.