Updated split_iterators to use Vec::with_capacity instead of Vec::new.

This commit is contained in:
Jack Yu 2021-04-20 21:18:45 -04:00
parent d7745fd38a
commit 56aa88fbbd
1 changed files with 1 additions and 2 deletions

View File

@ -121,8 +121,7 @@ impl ThreadPoolManager {
where
T: Iterator<Item = S>,
{
let mut split = Vec::new();
split.reserve_exact(self.num_threads);
let mut split = Vec::with_capacity(self.num_threads);
for _ in 0..self.num_threads {
split.push(Vec::new());
}