We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88f755f commit 8d18e57Copy full SHA for 8d18e57
src/libcore/benches/iter.rs
@@ -35,7 +35,7 @@ fn scatter(x: i32) -> i32 { (x * 31) % 127 }
35
fn bench_max_by_key(b: &mut Bencher) {
36
b.iter(|| {
37
let it = 0..100;
38
- it.max_by_key(|&x| scatter(x))
+ it.map(black_box).max_by_key(|&x| scatter(x))
39
})
40
}
41
@@ -56,7 +56,7 @@ fn bench_max_by_key2(b: &mut Bencher) {
56
fn bench_max(b: &mut Bencher) {
57
58
59
- it.map(scatter).max()
+ it.map(black_box).map(scatter).max()
60
61
62
0 commit comments