The following collect is wasteful, we should be able to reuse the map since all we're doing is retaining changed slots and shrinking the value type (EvmStorageSlot -> StorageSlot).
cc @rakita for ideas on how to do this.
Ideally fixing this wouldn't be too invasive.
|
let changed_storage = account |
|
.storage |
|
.into_iter() |
|
.filter(|(_, slot)| slot.is_changed()) |
|
.map(|(key, slot)| (key, slot.into())) |
|
.collect(); |
The following collect is wasteful, we should be able to reuse the map since all we're doing is
retaining changed slots and shrinking the value type (EvmStorageSlot -> StorageSlot).cc @rakita for ideas on how to do this.
Ideally fixing this wouldn't be too invasive.
revm/crates/database/src/states/cache.rs
Lines 213 to 218 in fc750ca