Skip to content

Commit

Permalink
perf(blockchain-tree:) use Vec::reserve_exact (paradigmxyz#11839)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg authored Oct 17, 2024
1 parent 1aa3ce1 commit 0a1473b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ where
// check unconnected block buffer for children of the chains
let mut all_chain_blocks = Vec::new();
for chain in self.state.chains.values() {
all_chain_blocks.reserve_exact(chain.blocks().len());
for (&number, block) in chain.blocks() {
all_chain_blocks.push(BlockNumHash { number, hash: block.hash() })
}
Expand Down

0 comments on commit 0a1473b

Please sign in to comment.