Browse Source

Use Vec::with_capacity() to allocate new indices vector

master
str4d 7 years ago
parent
commit
8b8ece69cd
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
  1. 2
      src/equihash.rs

2
src/equihash.rs

@ -62,7 +62,7 @@ impl Node {
.skip(trim)
.map(|(a, b)| a ^ b)
.collect();
let mut indices = Vec::new();
let mut indices = Vec::with_capacity(a.indices.len() + b.indices.len());
if a.indices_before(b) {
indices.extend(a.indices.iter());
indices.extend(b.indices.iter());

Loading…
Cancel
Save