Skip to content

Commit 55ba9e4

Browse files
authored
Reorder benches const variable
Move LEN so it is is read in order.
1 parent 26373fb commit 55ba9e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/alloc/benches/vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ fn bench_in_place_collect_droppable(b: &mut Bencher) {
570570
})
571571
}
572572

573+
const LEN: usize = 16384;
574+
573575
#[bench]
574576
fn bench_chain_collect(b: &mut Bencher) {
575577
let data = black_box([0; LEN]);
@@ -613,8 +615,6 @@ pub fn map_fast(l: &[(u32, u32)]) -> Vec<u32> {
613615
result
614616
}
615617

616-
const LEN: usize = 16384;
617-
618618
#[bench]
619619
fn bench_range_map_collect(b: &mut Bencher) {
620620
b.iter(|| (0..LEN).map(|_| u32::default()).collect::<Vec<_>>());

0 commit comments

Comments
 (0)