Lines Matching defs:pos
89 if min_suffix.pos > max_suffix.pos {
90 (min_suffix.period, min_suffix.pos)
92 (max_suffix.period, max_suffix.pos)
160 let mut pos = 0;
162 while pos + needle.len() <= haystack.len() {
166 pos += pre.call(&haystack[pos..], needle)?;
169 if pos + needle.len() > haystack.len() {
174 if !self.0.byteset.contains(haystack[pos + last_byte]) {
175 pos += needle.len();
179 while i < needle.len() && needle[i] == haystack[pos + i] {
183 pos += i - self.0.critical_pos + 1;
187 while j > shift && needle[j] == haystack[pos + j] {
190 if j <= shift && needle[shift] == haystack[pos + shift] {
191 return Some(pos);
193 pos += period;
209 let mut pos = 0;
210 'outer: while pos + needle.len() <= haystack.len() {
213 pos += pre.call(&haystack[pos..], needle)?;
214 if pos + needle.len() > haystack.len() {
220 if !self.0.byteset.contains(haystack[pos + last_byte]) {
221 pos += needle.len();
225 while i < needle.len() && needle[i] == haystack[pos + i] {
229 pos += i - self.0.critical_pos + 1;
232 if needle[j] != haystack[pos + j] {
233 pos += shift;
237 return Some(pos);
256 if min_suffix.pos < max_suffix.pos {
257 (min_suffix.period, min_suffix.pos)
259 (max_suffix.period, max_suffix.pos)
318 let mut pos = haystack.len();
320 while pos >= nlen {
321 if !self.0.byteset.contains(haystack[pos - nlen]) {
322 pos -= nlen;
327 while i > 0 && needle[i - 1] == haystack[pos - nlen + i - 1] {
330 if i > 0 || needle[0] != haystack[pos - nlen] {
331 pos -= self.0.critical_pos - i + 1;
335 while j < shift && needle[j] == haystack[pos - nlen + j] {
339 return Some(pos - nlen);
341 pos -= period;
356 let mut pos = haystack.len();
357 while pos >= nlen {
358 if !self.0.byteset.contains(haystack[pos - nlen]) {
359 pos -= nlen;
363 while i > 0 && needle[i - 1] == haystack[pos - nlen + i - 1] {
366 if i > 0 || needle[0] != haystack[pos - nlen] {
367 pos -= self.0.critical_pos - i + 1;
370 while j < nlen && needle[j] == haystack[pos - nlen + j] {
374 return Some(pos - nlen);
376 pos -= shift;
482 /// If this is a forward suffix, then `&bytes[pos..]` can be used. If this
483 /// is a reverse suffix, then `&bytes[..pos]` can be used. That is, for
486 pos: usize,
501 let mut suffix = Suffix { pos: 0, period: 1 };
520 let current = needle[suffix.pos + offset];
524 suffix = Suffix { pos: candidate_start, period: 1 };
531 suffix.period = candidate_start - suffix.pos;
550 let mut suffix = Suffix { pos: needle.len(), period: 1 };
558 let current = needle[suffix.pos - offset - 1];
562 suffix = Suffix { pos: candidate_start, period: 1 };
569 suffix.period = suffix.pos - candidate_start;
682 (&needle[s.pos..], s.period)
688 (&needle[..s.pos], s.period)