mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
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
|
// collect all the nodes and return them
|
||||||
for _, node := range visited {
|
for _, node := range visited {
|
||||||
nodes = append(nodes, node)
|
nodes = append(nodes, node)
|
||||||
|
Loading…
Reference in New Issue
Block a user