create some vectors with initial capacities (#3701)

Signed-off-by: Benjamin Coenen <benjamin.coenen@hotmail.com>
This commit is contained in:
Coenen Benjamin authored and Bastian Köcher committed 2019-09-27 11:46:53 +02:00
1 parent 62be947877
commit 53a43e92aa
3 files changed
+17 -19

No files matched your search

+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());