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

ethdb:init map with known size
This commit is contained in:
ucwong 2023-05-11 01:13:25 -06:00 committed by GitHub
parent c8b0afb2c4
commit d17ec0ea66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
}