std: add benchmark for vec.mut_iter.
This commit is contained in:
parent
fbb7cd32c3
commit
1992765dd3
@ -3595,4 +3595,17 @@ fn iterator(bh: &mut BenchHarness) {
|
||||
if sum == 0 {fail!()}
|
||||
}
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn mut_iterator(bh: &mut BenchHarness) {
|
||||
let mut v = vec::from_elem(100, 0);
|
||||
|
||||
do bh.iter {
|
||||
let mut i = 0;
|
||||
foreach x in v.mut_iter() {
|
||||
*x = i;
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user