Don't preallocate the slice if you don't index later on.
This commit is contained in:
parent
b50c44a758
commit
3ea4490d6c
@ -812,7 +812,7 @@ func (n *network) Nodes() []Node {
|
||||
}
|
||||
}
|
||||
|
||||
nodes := make([]Node, len(visited))
|
||||
var nodes []Node
|
||||
// collect all the nodes and return them
|
||||
for _, node := range visited {
|
||||
nodes = append(nodes, node)
|
||||
|
Loading…
x
Reference in New Issue
Block a user