mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
triedb/pathdb: prealloc node map in nodeSet.write (#35232)
This commit is contained in:
parent
04bf045303
commit
32986bf084
1 changed files with 1 additions and 1 deletions
|
|
@ -279,7 +279,7 @@ func (s *nodeSet) decode(r *rlp.Stream) error {
|
||||||
|
|
||||||
// write flushes nodes into the provided database batch as a whole.
|
// write flushes nodes into the provided database batch as a whole.
|
||||||
func (s *nodeSet) write(batch ethdb.Batch, clean *fastcache.Cache) int {
|
func (s *nodeSet) write(batch ethdb.Batch, clean *fastcache.Cache) int {
|
||||||
nodes := make(map[common.Hash]map[string]*trienode.Node)
|
nodes := make(map[common.Hash]map[string]*trienode.Node, len(s.storageNodes)+1)
|
||||||
if len(s.accountNodes) > 0 {
|
if len(s.accountNodes) > 0 {
|
||||||
nodes[common.Hash{}] = s.accountNodes
|
nodes[common.Hash{}] = s.accountNodes
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue