Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Avoid redundant clone. #6989

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions runtime/parachains/src/paras_inherent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ where
/// as well as their indices in ascending order.
fn random_sel<X, F: Fn(&X) -> Weight>(
rng: &mut rand_chacha::ChaChaRng,
selectables: Vec<X>,
selectables: &[X],
mut preferred_indices: Vec<usize>,
weight_fn: F,
weight_limit: Weight,
Expand Down Expand Up @@ -892,7 +892,7 @@ fn apply_weight_limit<T: Config + inclusion::Config>(
let (acc_candidate_weight, indices) =
random_sel::<BackedCandidate<<T as frame_system::Config>::Hash>, _>(
rng,
candidates.clone(),
&candidates,
preferred_indices,
|c| backed_candidate_weight::<T>(c),
max_consumable_by_candidates,
Expand All @@ -911,7 +911,7 @@ fn apply_weight_limit<T: Config + inclusion::Config>(
// into the block and skip the candidates entirely
let (total_consumed, indices) = random_sel::<UncheckedSignedAvailabilityBitfield, _>(
rng,
bitfields.clone(),
&bitfields,
vec![],
|_| <<T as Config>::WeightInfo as WeightInfo>::enter_bitfields(),
max_consumable_weight,
Expand Down Expand Up @@ -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::<u32, _>(
rng,
d,
&d,
vec![],
|v| <<T as Config>::WeightInfo as WeightInfo>::enter_variable_disputes(*v),
max_consumable_weight.saturating_sub(weight_acc),
Expand Down