Don't preallocate the slice if you don't index later on.
This commit is contained in:
		| @@ -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) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user