MCPcopy Create free account
hub / github.com/weaveworks/scope / Delete

Method Delete

report/node_set.go:61–73  ·  view source on GitHub ↗

Delete deletes the nodes from the NodeSet by ID. Delete is the only valid way to shrink a NodeSet. Delete returns the NodeSet to enable chaining.

(ids ...string)

Source from the content-addressed store, hash-verified

59// Delete deletes the nodes from the NodeSet by ID. Delete is the only valid
60// way to shrink a NodeSet. Delete returns the NodeSet to enable chaining.
61func (n NodeSet) Delete(ids ...string) NodeSet {
62 if n.Size() == 0 {
63 return n
64 }
65 result := n.psMap
66 for _, id := range ids {
67 result = result.Delete(id)
68 }
69 if result.Size() == 0 {
70 return emptyNodeSet
71 }
72 return NodeSet{result}
73}
74
75// UnsafeMerge combines the two NodeSets, altering n
76func (n *NodeSet) UnsafeMerge(other NodeSet) {

Callers

nothing calls this directly

Calls 2

SizeMethod · 0.95
DeleteMethod · 0.65

Tested by

no test coverage detected