ethdb/memorydb: init map with known size (#27241)

ethdb:init map with known size
This commit is contained in:
ucwong
2023-05-11 10:13:25 +03:00
committed by GitHub
parent c8b0afb2c4
commit d17ec0ea66
+1 -1
View File
@@ -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)
}