From d17ec0ea66e733062ac4a02122a1ddd81bc75631 Mon Sep 17 00:00:00 2001 From: ucwong Date: Thu, 11 May 2023 01:13:25 -0600 Subject: [PATCH] ethdb/memorydb: init map with known size (#27241) ethdb:init map with known size --- ethdb/memorydb/memorydb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethdb/memorydb/memorydb.go b/ethdb/memorydb/memorydb.go index 7e4fd7e5e..6ca7ce7d9 100644 --- a/ethdb/memorydb/memorydb.go +++ b/ethdb/memorydb/memorydb.go @@ -342,7 +342,7 @@ func newSnapshot(db *Database) *snapshot { db.lock.RLock() defer db.lock.RUnlock() - copied := make(map[string][]byte) + copied := make(map[string][]byte, len(db.db)) for key, val := range db.db { copied[key] = common.CopyBytes(val) }