File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ func NewNodeSet(owner common.Hash) *NodeSet {
78
78
// ForEachWithOrder iterates the nodes with the order from bottom to top,
79
79
// right to left, nodes with the longest path will be iterated first.
80
80
func (set * NodeSet ) ForEachWithOrder (callback func (path string , n * Node )) {
81
- var paths []string
81
+ paths := make ( []string , 0 , len ( set . Nodes ))
82
82
for path := range set .Nodes {
83
83
paths = append (paths , path )
84
84
}
@@ -133,7 +133,7 @@ func (set *NodeSet) Size() (int, int) {
133
133
// Hashes returns the hashes of all updated nodes. TODO(rjl493456442) how can
134
134
// we get rid of it?
135
135
func (set * NodeSet ) Hashes () []common.Hash {
136
- var ret []common.Hash
136
+ ret := make ( []common.Hash , 0 , len ( set . Nodes ))
137
137
for _ , node := range set .Nodes {
138
138
ret = append (ret , node .Hash )
139
139
}
You can’t perform that action at this time.
0 commit comments