@@ -3,7 +3,7 @@ use super::{
33} ;
44use bytecode:: Bytecode ;
55use primitives:: { Address , HashMap , B256 } ;
6- use state:: { Account , AccountInfo , EvmState } ;
6+ use state:: { Account , AccountInfo } ;
77use std:: vec:: Vec ;
88
99/// Cache state contains both modified and original values
@@ -89,14 +89,18 @@ impl CacheState {
8989 }
9090
9191 /// Applies output of revm execution and create account transitions that are used to build BundleState.
92- pub fn apply_evm_state ( & mut self , evm_state : EvmState ) -> Vec < ( Address , TransitionAccount ) > {
93- let mut transitions = Vec :: with_capacity ( evm_state. len ( ) ) ;
94- for ( address, account) in evm_state {
95- if let Some ( transition) = self . apply_account_state ( address, account) {
96- transitions. push ( ( address, transition) ) ;
97- }
98- }
99- transitions
92+ #[ inline]
93+ pub fn apply_evm_state (
94+ & mut self ,
95+ evm_state : impl IntoIterator < Item = ( Address , Account ) > ,
96+ ) -> Vec < ( Address , TransitionAccount ) > {
97+ evm_state
98+ . into_iter ( )
99+ . filter_map ( |( address, account) | {
100+ self . apply_account_state ( address, account)
101+ . map ( |transition| ( address, transition) )
102+ } )
103+ . collect ( )
100104 }
101105
102106 /// Pretty print the cache state for debugging purposes.
0 commit comments