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

This commit is contained in:
str4d 2018-04-12 17:47:38 -06:00
parent b693e56ead
commit 8b8ece69cd
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
1 changed files with 1 additions and 1 deletions

View File

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