runtime: use Vec::with_capacity when building runtime (#4553)

This commit is contained in:
Alex Saveau 2022-03-02 03:41:43 -08:00 committed by GitHub
parent 6f9a586214
commit fb9a01b362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {