mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
create some vectors with initial capacities (#3701)
Signed-off-by: Benjamin Coenen <benjamin.coenen@hotmail.com>
This commit is contained in:
committed by
Bastian Köcher
parent
62be947877
commit
53a43e92aa
@@ -61,8 +61,7 @@ fn do_phragmen(
|
||||
// prefix to distinguish the validator and nominator account ranges.
|
||||
let np = 10_000;
|
||||
|
||||
let mut candidates = vec![];
|
||||
let mut voters = vec![];
|
||||
let mut candidates = Vec::with_capacity(num_vals as usize);
|
||||
let mut slashable_balance_of: BTreeMap<AccountId, Balance> = BTreeMap::new();
|
||||
|
||||
(1 ..= num_vals)
|
||||
@@ -71,6 +70,7 @@ fn do_phragmen(
|
||||
slashable_balance_of.insert(acc, STAKE + rr(10, 50));
|
||||
});
|
||||
|
||||
let mut voters = Vec::with_capacity(num_noms as usize);
|
||||
(np ..= (np + num_noms))
|
||||
.for_each(|acc| {
|
||||
let mut stashes_to_vote = candidates.clone();
|
||||
|
||||
Reference in New Issue
Block a user