Skip to content

Commit 15164ed

Browse files
committed
simply dont use memchr
1 parent c16ca8c commit 15164ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/core/src/str/pattern.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ unsafe impl<'a> Searcher<'a> for AsciiCharSearcher<'a> {
395395

396396
#[inline(always)]
397397
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-
}) {
398+
match unsafe { self.haystack.as_bytes().get_unchecked(self.finger..self.finger_back) }
399+
.iter()
400+
.position(|x| *x == self.needle)
401+
{
401402
Some(x) => {
402403
self.finger += x + 1;
403404
Some((self.finger - 1, self.finger))

0 commit comments

Comments
 (0)