From 4659387a02ff4d764d402e5d50eb3b43abfc9963 Mon Sep 17 00:00:00 2001 From: eskimor Date: Fri, 31 Mar 2023 16:53:05 +0200 Subject: [PATCH] Avoid redundant clone. (#6989) Co-authored-by: eskimor --- runtime/parachains/src/paras_inherent/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/parachains/src/paras_inherent/mod.rs b/runtime/parachains/src/paras_inherent/mod.rs index c2dff1e16487..6773d9f7ca00 100644 --- a/runtime/parachains/src/paras_inherent/mod.rs +++ b/runtime/parachains/src/paras_inherent/mod.rs @@ -791,7 +791,7 @@ where /// as well as their indices in ascending order. fn random_sel Weight>( rng: &mut rand_chacha::ChaChaRng, - selectables: Vec, + selectables: &[X], mut preferred_indices: Vec, weight_fn: F, weight_limit: Weight, @@ -892,7 +892,7 @@ fn apply_weight_limit( let (acc_candidate_weight, indices) = random_sel::::Hash>, _>( rng, - candidates.clone(), + &candidates, preferred_indices, |c| backed_candidate_weight::(c), max_consumable_by_candidates, @@ -911,7 +911,7 @@ fn apply_weight_limit( // into the block and skip the candidates entirely let (total_consumed, indices) = random_sel::( rng, - bitfields.clone(), + &bitfields, vec![], |_| <::WeightInfo as WeightInfo>::enter_bitfields(), max_consumable_weight, @@ -1282,7 +1282,7 @@ fn limit_and_sanitize_disputes< // Select remote disputes at random until the block is full let (_acc_remote_disputes_weight, mut indices) = random_sel::( rng, - d, + &d, vec![], |v| <::WeightInfo as WeightInfo>::enter_variable_disputes(*v), max_consumable_weight.saturating_sub(weight_acc),