File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
crates/revm/src/db/states Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -282,12 +282,11 @@ impl CacheAccount {
282
282
storage : StorageWithOriginalValues ,
283
283
) -> TransitionAccount {
284
284
let previous_status = self . status ;
285
- let previous_info = self . account . as_ref ( ) . map ( |a| a. info . clone ( ) ) ;
286
- let mut this_storage = self
287
- . account
288
- . take ( )
289
- . map ( |acc| acc. storage )
290
- . unwrap_or_default ( ) ;
285
+ let ( previous_info, mut this_storage) = if let Some ( account) = self . account . take ( ) {
286
+ ( Some ( account. info ) , account. storage )
287
+ } else {
288
+ ( None , Default :: default ( ) )
289
+ } ;
291
290
292
291
this_storage. extend ( storage. iter ( ) . map ( |( k, s) | ( * k, s. present_value ) ) ) ;
293
292
let changed_account = PlainAccount {
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ impl TransitionAccount {
85
85
/// Update new values of transition. Don't override old values.
86
86
/// Both account info and old storages need to be left intact.
87
87
pub fn update ( & mut self , other : Self ) {
88
- self . info . clone_from ( & other. info ) ;
88
+ self . info = other. info ;
89
89
self . status = other. status ;
90
90
91
91
// if transition is from some to destroyed drop the storage.
You can’t perform that action at this time.
0 commit comments