Skip to content

Commit

Permalink
ethdb/memorydb: init map with known size (ethereum#27241)
Browse files Browse the repository at this point in the history
ethdb:init map with known size
  • Loading branch information
ucwong authored May 11, 2023
1 parent c8b0afb commit d17ec0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethdb/memorydb/memorydb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d17ec0e

Please sign in to comment.