From 79ee368e1190b1ff6cb45aadf196350032d26b94 Mon Sep 17 00:00:00 2001 From: phrwlk Date: Fri, 14 Nov 2025 21:43:30 +0200 Subject: [PATCH] fix(cheatcodes): avoid unnecessary clone in create_end when merging recorded account diffs --- crates/cheatcodes/src/inspector.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/cheatcodes/src/inspector.rs b/crates/cheatcodes/src/inspector.rs index a3befbd6f5fc6..5b69e3968042c 100644 --- a/crates/cheatcodes/src/inspector.rs +++ b/crates/cheatcodes/src/inspector.rs @@ -1812,7 +1812,7 @@ impl Inspector> for Cheatcodes { if let Some(recorded_account_diffs_stack) = &mut self.recorded_account_diffs_stack { // The root call cannot be recorded. if curr_depth > 0 - && let Some(last_depth) = &mut recorded_account_diffs_stack.pop() + && let Some(mut last_depth) = recorded_account_diffs_stack.pop() { // Update the reverted status of all deeper calls if this call reverted, in // accordance with EVM behavior @@ -1852,9 +1852,9 @@ impl Inspector> for Cheatcodes { // vector if higher depths were not recorded. This // preserves ordering of accesses. if let Some(last) = recorded_account_diffs_stack.last_mut() { - last.append(last_depth); + last.append(&mut last_depth); } else { - recorded_account_diffs_stack.push(last_depth.clone()); + recorded_account_diffs_stack.push(last_depth); } } }