optimize vector fill

This commit is contained in:
Øsystems 2020-01-21 15:00:19 +10:00
parent dbfa13d6be
commit 6f202ae3b5
1 changed files with 5 additions and 5 deletions

View File

@ -263,12 +263,12 @@ impl ServerBuilder {
info!("Starting {} workers", self.threads);
// start workers
let mut workers = Vec::new();
for idx in 0..self.threads {
let workers = (0..self.threads).map(|idx| {
let worker = self.start_worker(idx, self.accept.get_notify());
workers.push(worker.clone());
self.workers.push((idx, worker));
}
self.workers.push((idx, worker.clone()));
worker
}).collect();
// start accept thread
for sock in &self.sockets {