Skip to content

Commit

Permalink
Prevent bench_year_flags_from_year from being optimized out
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker authored and djc committed May 11, 2023
1 parent 005ec07 commit 4ce9e83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benches/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn bench_year_flags_from_year(c: &mut Criterion) {
c.bench_function("bench_year_flags_from_year", |b| {
b.iter(|| {
for year in -999i32..1000 {
__BenchYearFlags::from_year(year);
let _ = __BenchYearFlags::from_year(black_box(year));
}
})
});
Expand Down

0 comments on commit 4ce9e83

Please sign in to comment.