Skip to content

Commit

Permalink
runtime: use Vec::with_capacity when building runtime (#4553)
Browse files Browse the repository at this point in the history
  • Loading branch information
SUPERCILEX committed Mar 2, 2022
1 parent 6f9a586 commit fb9a01b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tokio/src/runtime/thread_pool/worker.rs
Expand Up @@ -194,9 +194,9 @@ pub(super) fn create(
before_park: Option<Callback>,
after_unpark: Option<Callback>,
) -> (Arc<Shared>, Launch) {
let mut cores = vec![];
let mut remotes = vec![];
let mut worker_metrics = vec![];
let mut cores = Vec::with_capacity(size);
let mut remotes = Vec::with_capacity(size);
let mut worker_metrics = Vec::with_capacity(size);

// Create the local queues
for _ in 0..size {
Expand Down

0 comments on commit fb9a01b

Please sign in to comment.