mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
optimization: store just IDs of child nodes
IDs are a lot smaller, hence quicker to manage. Any time we want to refer back to the full node we look it up in its topology. (This relies on nobody trying to store a rendered node as a child).
This commit is contained in:
@@ -103,13 +103,7 @@ func FilterEmpty(topology string, r Renderer) Renderer {
|
||||
// topology.
|
||||
func HasChildren(topology string) FilterFunc {
|
||||
return func(n report.Node) bool {
|
||||
count := 0
|
||||
n.Children.ForEach(func(child report.Node) {
|
||||
if child.Topology == topology {
|
||||
count++
|
||||
}
|
||||
})
|
||||
return count > 0
|
||||
return len(n.ChildIDs) > 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user