Skip to content

Commit

Permalink
use clone_from in quicksort bench
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronBorn authored Feb 12, 2024
1 parent 804a3ef commit b45d887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rayon-demo/src/quicksort/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn bench_harness<F: FnMut(&mut [u32])>(mut f: F, b: &mut test::Bencher) {
let base_vec = super::default_vec(BENCH_SIZE);
let mut sort_vec = vec![];
b.iter(|| {
sort_vec = base_vec.clone();
sort_vec.clone_from(&base_vec);
f(&mut sort_vec);
});
assert!(super::is_sorted(&sort_vec));
Expand Down

0 comments on commit b45d887

Please sign in to comment.