Skip to content

Commit

Permalink
Merge pull request #1273 from waywardmonkeys/blackbox-criterion
Browse files Browse the repository at this point in the history
Use std::hint::black_box consistently.
  • Loading branch information
sebcrozet committed Sep 30, 2023
2 parents 2043824 + 9042d14 commit d2d2571
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions benches/core/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn iter(bench: &mut criterion::Criterion) {
bench.bench_function("iter", move |bh| {
bh.iter(|| {
for value in a.iter() {
criterion::black_box(value);
std::hint::black_box(value);
}
})
});
Expand All @@ -154,7 +154,7 @@ fn iter_rev(bench: &mut criterion::Criterion) {
bench.bench_function("iter_rev", move |bh| {
bh.iter(|| {
for value in a.iter().rev() {
criterion::black_box(value);
std::hint::black_box(value);
}
})
});
Expand Down
1 change: 0 additions & 1 deletion benches/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(bench_black_box)]
#![allow(unused_macros)]

extern crate nalgebra as na;
Expand Down

0 comments on commit d2d2571

Please sign in to comment.