Skip to content

Conversation

@phrwlk
Copy link
Contributor

@phrwlk phrwlk commented Nov 14, 2025

The recorded account diffs handling in create_end used a temporary borrow of pop()’s result and fell back to cloning the popped vector to return it to the stack. This introduces needless allocations and diverges from the ownership pattern used in call_end. The code now takes ownership of the popped vector (let Some(mut last_depth) = recorded_account_diffs_stack.pop()), performs the same updates, and either appends into the previous depth via append(&mut last_depth) or pushes last_depth back without cloning. This preserves behavior and ordering semantics while eliminating an unnecessary clone and aligning the implementation with call_end for consistency and performance.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep this as is

@DaniPopes DaniPopes closed this Nov 17, 2025
@github-project-automation github-project-automation bot moved this to Done in Foundry Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants