mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
chore(tree): use with_capacity at collect_blocks_for_canonical_unwind() (#20682)
This commit is contained in:
@@ -825,7 +825,8 @@ where
|
||||
new_head_number: u64,
|
||||
current_head_number: u64,
|
||||
) -> Vec<ExecutedBlock<N>> {
|
||||
let mut old_blocks = Vec::new();
|
||||
let mut old_blocks =
|
||||
Vec::with_capacity((current_head_number.saturating_sub(new_head_number)) as usize);
|
||||
|
||||
for block_num in (new_head_number + 1)..=current_head_number {
|
||||
if let Some(block_state) = self.canonical_in_memory_state.state_by_number(block_num) {
|
||||
|
||||
Reference in New Issue
Block a user