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

This commit is contained in:
str4d
2018-05-24 16:30:56 +12:00
parent b693e56ead
commit 8b8ece69cd
+1 -1
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());