Rollup merge of #77334 - pickfire:patch-4, r=jyn514

Reorder benches const variable

Move LEN so it is is read in order.
This commit is contained in:
Yuki Okushi 2020-10-30 18:00:41 +09:00 committed by GitHub
commit 0723b274d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -570,6 +570,8 @@ fn bench_in_place_collect_droppable(b: &mut Bencher) {
})
}
const LEN: usize = 16384;
#[bench]
fn bench_chain_collect(b: &mut Bencher) {
let data = black_box([0; LEN]);
@ -613,8 +615,6 @@ pub fn map_fast(l: &[(u32, u32)]) -> Vec<u32> {
result
}
const LEN: usize = 16384;
#[bench]
fn bench_range_map_collect(b: &mut Bencher) {
b.iter(|| (0..LEN).map(|_| u32::default()).collect::<Vec<_>>());