Skip to content

Commit

Permalink
Don't clone last journal Vec in calc_diff_size (#1472)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpp authored Nov 18, 2024
1 parent 23e2266 commit 08cbdb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/evm/src/evm/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ fn calc_diff_size<EXT, SPEC: Spec, DB: Database>(
} = &mut context.evm.inner;

// Get the last journal entry to calculate diff.
let journal = journaled_state.journal.last().cloned().unwrap_or(vec![]);
let journal = journaled_state.journal.last().into_iter().flatten();
let state = &journaled_state.state;

#[derive(Default)]
Expand All @@ -457,7 +457,7 @@ fn calc_diff_size<EXT, SPEC: Spec, DB: Database>(
let from = account_changes.entry(&env.tx.caller).or_default();
from.account_info_changed = true;

for entry in &journal {
for entry in journal {
match entry {
JournalEntry::NonceChange { address } => {
let account = account_changes.entry(address).or_default();
Expand Down

0 comments on commit 08cbdb0

Please sign in to comment.