It turns out that it was wrong. (See regression test that failed.) Namely, the bit tricks used for the scalar version of memchr only tell us whether a byte occurs within a usize, but not how many there are. It seems like it should be able to be adapted to do a count, but I couldn't quite figure it out. So for now, we just fall back to a byte-at-a-time loop.
It turns out that it was wrong. (See regression test that failed.) Namely, the bit tricks used for the scalar version of memchr only tell us whether a byte occurs within a usize, but not how many there are. It seems like it should be able to be adapted to do a count, but I couldn't quite figure it out. So for now, we just fall back to a byte-at-a-time loop.