We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c16ca8c commit 15164edCopy full SHA for 15164ed
library/core/src/str/pattern.rs
@@ -395,9 +395,10 @@ unsafe impl<'a> Searcher<'a> for AsciiCharSearcher<'a> {
395
396
#[inline(always)]
397
fn next_match(&mut self) -> Option<(usize, usize)> {
398
- match memchr::memchr(self.needle, unsafe {
399
- &self.haystack.as_bytes().get_unchecked(self.finger..self.finger_back)
400
- }) {
+ match unsafe { self.haystack.as_bytes().get_unchecked(self.finger..self.finger_back) }
+ .iter()
+ .position(|x| *x == self.needle)
401
+ {
402
Some(x) => {
403
self.finger += x + 1;
404
Some((self.finger - 1, self.finger))
0 commit comments