mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: use Vec::with_capacity and reserve_exact (#11904)
This commit is contained in:
@ -66,7 +66,7 @@ fn generate_many_transactions(senders: usize, max_depth: usize) -> Vec<MockTrans
|
||||
let rng = TestRng::from_seed(RngAlgorithm::ChaCha, &SEED);
|
||||
let mut runner = TestRunner::new_with_rng(config, rng);
|
||||
|
||||
let mut txs = Vec::new();
|
||||
let mut txs = Vec::with_capacity(senders);
|
||||
for idx in 0..senders {
|
||||
// modulo max_depth so we know it is bounded, plus one so the minimum is always 1
|
||||
let depth = any::<usize>().new_tree(&mut runner).unwrap().current() % max_depth + 1;
|
||||
|
||||
Reference in New Issue
Block a user