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

Method Copy

report/node_set.go:28–34  ·  view source on GitHub ↗

Copy returns a value copy of the Nodes.

()

Source from the content-addressed store, hash-verified

26
27// Copy returns a value copy of the Nodes.
28func (n NodeSet) Copy() NodeSet {
29 result := ps.NewMap()
30 n.ForEach(func(node Node) {
31 result = result.UnsafeMutableSet(node.ID, node)
32 })
33 return NodeSet{result}
34}
35
36// UnsafeAdd adds a node to the NodeSet. Only call this if n has one owner.
37func (n *NodeSet) UnsafeAdd(node Node) {

Callers

nothing calls this directly

Calls 1

ForEachMethod · 0.95

Tested by

no test coverage detected