Skip to content

eliminate temporary active balances allocation - #643

Open
ashleychandy wants to merge 1 commit into
0dotxyz:0.1.10-mainfrom
ashleychandy:remove-active-balances-allocation
Open

eliminate temporary active balances allocation#643
ashleychandy wants to merge 1 commit into
0dotxyz:0.1.10-mainfrom
ashleychandy:remove-active-balances-allocation

Conversation

@ashleychandy

Copy link
Copy Markdown
Contributor

Description

Remove the temporary active_balances allocation in BankAccountWithCache::load and iterate directly over active balances while preserving the existing behavior.

Changes

  • Replaced the temporary Vec<&Balance> with an active balance counter.
  • Compute banks_only using the active balance count.
  • Iterate directly over balances.iter().filter(|balance| balance.is_active()).
  • Eliminated the unnecessary heap allocation while keeping the processing order and validation logic unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant