Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
use Vec::with_capacity
Browse files Browse the repository at this point in the history
Co-Authored-By: seunlanlege <seunlanlege@gmail.com>
  • Loading branch information
niklasad1 and seunlanlege authored Jan 3, 2019
1 parent c8d9849 commit dc6acf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ethcore/src/blockchain/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ impl BlockChain {
/// fetches the list of blocks from best block to n, and n's parent hash
/// where n > 0
pub fn block_headers_from_best_block(&self, n: u64) -> Option<(Vec<encoded::Header>, H256)> {
let mut blocks = vec![];
let mut blocks = Vec::with_capacity(n);
let mut hash = self.best_block_hash();

for _ in 0..n {
Expand Down

0 comments on commit dc6acf4

Please sign in to comment.