From 55ba9e4755eb47555417c311b867bce6196da462 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 29 Sep 2020 21:39:24 +0800 Subject: [PATCH] Reorder benches const variable Move LEN so it is is read in order. --- library/alloc/benches/vec.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/benches/vec.rs b/library/alloc/benches/vec.rs index 789ae3a20eabf..89893b6209c0a 100644 --- a/library/alloc/benches/vec.rs +++ b/library/alloc/benches/vec.rs @@ -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 { result } -const LEN: usize = 16384; - #[bench] fn bench_range_map_collect(b: &mut Bencher) { b.iter(|| (0..LEN).map(|_| u32::default()).collect::>());