mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Refactor: streamline Node.WithParents()
Make it take parameters just like all the callers have, instead of making them create a different structure. It is now only used in tests.
This commit is contained in:
@@ -169,14 +169,8 @@ func (n Node) PruneParents() Node {
|
||||
}
|
||||
|
||||
// WithChildren returns a fresh copy of n, with children merged in.
|
||||
func (n Node) WithChildren(children NodeSet) Node {
|
||||
n.Children = n.Children.Merge(children)
|
||||
return n
|
||||
}
|
||||
|
||||
// WithChild returns a fresh copy of n, with one child merged in.
|
||||
func (n Node) WithChild(child Node) Node {
|
||||
n.Children = n.Children.Merge(MakeNodeSet(child))
|
||||
func (n Node) WithChildren(children ...Node) Node {
|
||||
n.Children = n.Children.Add(children...)
|
||||
return n
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user