From bcb8a8bffaa3bba9b6cdda045a1be39be853d321 Mon Sep 17 00:00:00 2001 From: GarmashAlex Date: Tue, 20 Jan 2026 20:55:49 +0300 Subject: [PATCH] perf: remove epoch heights allocation Signed-off-by: GarmashAlex --- ledger/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index 224388db7f..3cf8a456fe 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -320,9 +320,8 @@ impl> Ledger { } // Collect the addresses of the solutions submitted in the current epoch. - let existing_epoch_blocks: Vec<_> = (start..=current_block_height).collect(); - let solution_addresses = cfg_iter!(existing_epoch_blocks) - .flat_map(|height| match self.get_solutions(*height).as_deref() { + let solution_addresses = cfg_into_iter!(start..=current_block_height) + .flat_map(|height| match self.get_solutions(height).as_deref() { Ok(Some(solutions)) => solutions.iter().map(|(_, s)| s.address()).collect::>(), _ => vec![], })