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

ethdb:init map with known size
pull/27250/head
ucwong 2 years ago committed by GitHub
parent c8b0afb2c4
commit d17ec0ea66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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)
}

Loading…
Cancel
Save