Skip to content

Commit

Permalink
core/rawdb,eth/protocols,p2p: prealloc slice size (ethereum#29893)
Browse files Browse the repository at this point in the history
chore: prealloc slice size
  • Loading branch information
tianyeyouyou authored and stwiname committed Sep 9, 2024
1 parent 689c17e commit 3bbcb99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eth/protocols/snap/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3250,9 +3250,9 @@ func (t *healRequestSort) Merge() []TrieNodePathSet {
// sortByAccountPath takes hashes and paths, and sorts them. After that, it generates
// the TrieNodePaths and merges paths which belongs to the same account path.
func sortByAccountPath(paths []string, hashes []common.Hash) ([]string, []common.Hash, []trie.SyncPath, []TrieNodePathSet) {
var syncPaths []trie.SyncPath
for _, path := range paths {
syncPaths = append(syncPaths, trie.NewSyncPath([]byte(path)))
syncPaths := make([]trie.SyncPath, len(paths))
for i, path := range paths {
syncPaths[i] = trie.NewSyncPath([]byte(path))
}
n := &healRequestSort{paths, hashes, syncPaths}
sort.Sort(n)
Expand Down

0 comments on commit 3bbcb99

Please sign in to comment.