Lines Matching refs:pattern_length
89 int pattern_length = pattern_.length(); in StringSearch() local
90 if (pattern_length < kBMMinPatternLength) { in StringSearch()
91 if (pattern_length == 1) { in StringSearch()
268 int pattern_length = pattern.length(); in LinearSearch() local
271 int n = subject.length() - pattern_length; in LinearSearch()
287 pattern_length - 1)) { in LinearSearch()
305 int pattern_length = pattern.length(); in BoyerMooreSearch() local
312 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreSearch()
315 while (index <= subject_length - pattern_length) { in BoyerMooreSearch()
316 int j = pattern_length - 1; in BoyerMooreSearch()
322 if (index > subject_length - pattern_length) { in BoyerMooreSearch()
332 index += pattern_length - 1 in BoyerMooreSearch()
353 int pattern_length = pattern_.length(); in PopulateBoyerMooreTable() local
358 int length = pattern_length - start; in PopulateBoyerMooreTable()
366 for (int i = start; i < pattern_length; i++) { in PopulateBoyerMooreTable()
369 shift_table[pattern_length] = 1; in PopulateBoyerMooreTable()
370 suffix_table[pattern_length] = pattern_length + 1; in PopulateBoyerMooreTable()
372 if (pattern_length <= start) { in PopulateBoyerMooreTable()
377 PatternChar last_char = pattern[pattern_length - 1]; in PopulateBoyerMooreTable()
378 int suffix = pattern_length + 1; in PopulateBoyerMooreTable()
380 int i = pattern_length; in PopulateBoyerMooreTable()
383 while (suffix <= pattern_length && c != pattern[suffix - 1]) { in PopulateBoyerMooreTable()
390 if (suffix == pattern_length) { in PopulateBoyerMooreTable()
393 if (shift_table[pattern_length] == length) { in PopulateBoyerMooreTable()
394 shift_table[pattern_length] = pattern_length - i; in PopulateBoyerMooreTable()
396 suffix_table[--i] = pattern_length; in PopulateBoyerMooreTable()
405 if (suffix < pattern_length) { in PopulateBoyerMooreTable()
406 for (int i = start; i <= pattern_length; i++) { in PopulateBoyerMooreTable()
428 int pattern_length = pattern.length(); in BoyerMooreHorspoolSearch() local
430 int badness = -pattern_length; in BoyerMooreHorspoolSearch()
433 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreHorspoolSearch()
434 int last_char_shift = pattern_length - 1 - in BoyerMooreHorspoolSearch()
438 while (index <= subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
439 int j = pattern_length - 1; in BoyerMooreHorspoolSearch()
446 if (index > subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
460 badness += (pattern_length - j) - last_char_shift; in BoyerMooreHorspoolSearch()
474 int pattern_length = pattern_.length(); in PopulateBoyerMooreHorspoolTable() local
493 for (int i = start; i < pattern_length - 1; i++) { in PopulateBoyerMooreHorspoolTable()
512 int pattern_length = pattern.length(); in InitialSearch() local
516 int badness = -10 - (pattern_length << 2); in InitialSearch()
521 for (int i = index, n = subject.length() - pattern_length; i <= n; i++) { in InitialSearch()
542 } while (j < pattern_length); in InitialSearch()
543 if (j == pattern_length) { in InitialSearch()