create some vectors with initial capacities (#3701)

Signed-off-by: Benjamin Coenen <benjamin.coenen@hotmail.com>
This commit is contained in:
Coenen Benjamin
2019-09-27 11:46:53 +02:00
committed by Bastian Köcher
parent 62be947877
commit 53a43e92aa
3 changed files with 17 additions and 19 deletions
+2 -2
View File
@@ -737,8 +737,8 @@ impl StorageApi for () {
}
fn blake2_256_ordered_trie_root(input: Vec<Vec<u8>>) -> H256 {
let mut values = Vec::new();
let mut lengths = Vec::new();
let mut values = Vec::with_capacity(input.len());
let mut lengths = Vec::with_capacity(input.len());
for v in input {
values.extend_from_slice(&v);
lengths.push((v.len() as u32).to_le());