Skip to content

Commit

Permalink
Merge pull request #1131 from TheIronBorn/patch-3
Browse files Browse the repository at this point in the history
use clone_from in quicksort bench
  • Loading branch information
cuviper authored Feb 13, 2024
2 parents 804a3ef + 03317c8 commit 0b83185
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rayon-demo/src/mergesort/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const BENCH_SIZE: usize = 250_000_000 / 512;

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![];
let mut sort_vec = base_vec.clone();
b.iter(|| {
sort_vec = base_vec.clone();
sort_vec.clone_from(&base_vec);
f(&mut sort_vec);
});
assert!(super::is_sorted(&mut sort_vec));
Expand Down
4 changes: 2 additions & 2 deletions rayon-demo/src/quicksort/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const BENCH_SIZE: usize = 250_000_000 / 512;

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![];
let mut sort_vec = base_vec.clone();
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 0b83185

Please sign in to comment.