We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ef2b3e commit bc36279Copy full SHA for bc36279
library/core/src/slice/cmp.rs
@@ -267,10 +267,8 @@ macro_rules! impl_slice_contains {
267
// Make our LANE_COUNT 4x the normal lane count. The compiler will nicely unroll it.
268
const LANE_COUNT: usize = 4 * (128 / (mem::size_of::<$t>() * 8));
269
// SIMD
270
- let mut matches = [false; LANE_COUNT];
271
for chunk in arr.chunks_exact(LANE_COUNT){
272
- matches.iter_mut().zip(chunk).for_each(|(m, x)| *m = *x == *self);
273
- if matches.iter().fold(false, |acc, x| acc | x) {
+ if chunk.iter().fold(false, |acc, x| acc | (*x == *self)) {
274
return true;
275
}
276
0 commit comments