mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-03 00:50:41 +00:00
Removing usage of step_by
This commit is contained in:
@@ -320,13 +320,15 @@ mod tests {
|
||||
fn bench_intfastfield_linear_veclookup(b: &mut Bencher) {
|
||||
let permutation = generate_permutation();
|
||||
b.iter(|| {
|
||||
let n = test::black_box(7000u32);
|
||||
let mut a = 0u64;
|
||||
for i in (0u32..n).step_by(7) {
|
||||
a ^= permutation[i as usize];
|
||||
}
|
||||
a
|
||||
});
|
||||
let n = test::black_box(7000u32);
|
||||
let mut a = 0u64;
|
||||
let mut i = 0u32;
|
||||
while i < n {
|
||||
a ^= permutation[i as usize];
|
||||
i += 7;
|
||||
}
|
||||
a
|
||||
});
|
||||
}
|
||||
|
||||
#[bench]
|
||||
@@ -363,13 +365,15 @@ mod tests {
|
||||
let fast_field_reader: U64FastFieldReader =
|
||||
fast_field_readers.open_reader(*FIELD).unwrap();
|
||||
b.iter(|| {
|
||||
let n = test::black_box(7000u32);
|
||||
let mut a = 0u64;
|
||||
for i in (0u32..n).step_by(7) {
|
||||
a ^= fast_field_reader.get(i);
|
||||
}
|
||||
a
|
||||
});
|
||||
let n = test::black_box(7000u32);
|
||||
let mut a = 0u64;
|
||||
let mut i = 0u32;
|
||||
while i < n {
|
||||
a ^= fast_field_reader.get(i);
|
||||
i += 7;
|
||||
}
|
||||
a
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user