From 93d4c8a65643cc7c82cbe4bd5f1f2475ee8bc803 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 2 Feb 2021 16:23:16 +0100 Subject: [PATCH] No point in initializing the vector, since it always gets truncated first --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 63a9adb..77c8132 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -284,7 +284,7 @@ where // For layers above the zero layer, make a copy of the current state of the zero layer // with `nearest` truncated to `M` elements. if layer.0 > 0 { - let mut upper = vec![UpperNode::default(); zero.len()]; + let mut upper = Vec::new(); (&zero).into_par_iter() .map(|zero| UpperNode::from_zero(&zero.read())) .collect_into_vec(&mut upper);