mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-29 12:33:19 +00:00
Optimise NewDerivedNode()
Create the new node's children without making an intermediate NodeSet
This commit is contained in:
@@ -52,7 +52,9 @@ func ParseGroupNodeTopology(topology string) (string, string, bool) {
|
||||
|
||||
// NewDerivedNode makes a node based on node, but with a new ID
|
||||
func NewDerivedNode(id string, node report.Node) report.Node {
|
||||
return report.MakeNode(id).WithChildren(node.Children.Add(node))
|
||||
result := report.MakeNode(id)
|
||||
result.Children = node.Children.Add(node)
|
||||
return result
|
||||
}
|
||||
|
||||
// NewDerivedPseudoNode makes a new pseudo node with the node as a child
|
||||
|
||||
Reference in New Issue
Block a user