Skip to content

Commit

Permalink
Reformat benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy committed Nov 26, 2024
1 parent 5eedda0 commit c9049be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion benches/benches/seq_choose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ pub fn bench(c: &mut Criterion) {
b.iter(|| {
// Collect full result to prevent unwanted shortcuts getting
// first element (in case sample_indices returns an iterator).
for (slot, sample) in y.iter_mut().zip(x.choose_multiple_weighted(&mut rng, amount, |_| 1.0).unwrap()) {
let samples_iter = x
.choose_multiple_weighted(&mut rng, amount, |_| 1.0)
.unwrap();
for (slot, sample) in y.iter_mut().zip(samples_iter) {
*slot = *sample;
}
y[amount - 1]
Expand Down

0 comments on commit c9049be

Please sign in to comment.