ethdb/memorydb: init map with known size (#27241)
ethdb:init map with known size
This commit is contained in:
parent
c8b0afb2c4
commit
d17ec0ea66
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user