Lines Matching refs:pattern_length

69     int pattern_length = pattern_.length();  in StringSearch()  local
70 if (pattern_length < kBMMinPatternLength) { in StringSearch()
71 if (pattern_length == 1) { in StringSearch()
281 int pattern_length = pattern.length(); in LinearSearch() local
283 int n = subject.length() - pattern_length; in LinearSearch()
293 pattern_length - 1)) { in LinearSearch()
311 int pattern_length = pattern.length(); in BoyerMooreSearch() local
318 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreSearch()
321 while (index <= subject_length - pattern_length) { in BoyerMooreSearch()
322 int j = pattern_length - 1; in BoyerMooreSearch()
328 if (index > subject_length - pattern_length) { in BoyerMooreSearch()
338 index += pattern_length - 1 in BoyerMooreSearch()
359 int pattern_length = pattern_.length(); in PopulateBoyerMooreTable() local
364 int length = pattern_length - start; in PopulateBoyerMooreTable()
372 for (int i = start; i < pattern_length; i++) { in PopulateBoyerMooreTable()
375 shift_table[pattern_length] = 1; in PopulateBoyerMooreTable()
376 suffix_table[pattern_length] = pattern_length + 1; in PopulateBoyerMooreTable()
378 if (pattern_length <= start) { in PopulateBoyerMooreTable()
383 PatternChar last_char = pattern[pattern_length - 1]; in PopulateBoyerMooreTable()
384 int suffix = pattern_length + 1; in PopulateBoyerMooreTable()
386 int i = pattern_length; in PopulateBoyerMooreTable()
389 while (suffix <= pattern_length && c != pattern[suffix - 1]) { in PopulateBoyerMooreTable()
396 if (suffix == pattern_length) { in PopulateBoyerMooreTable()
399 if (shift_table[pattern_length] == length) { in PopulateBoyerMooreTable()
400 shift_table[pattern_length] = pattern_length - i; in PopulateBoyerMooreTable()
402 suffix_table[--i] = pattern_length; in PopulateBoyerMooreTable()
411 if (suffix < pattern_length) { in PopulateBoyerMooreTable()
412 for (int i = start; i <= pattern_length; i++) { in PopulateBoyerMooreTable()
434 int pattern_length = pattern.length(); in BoyerMooreHorspoolSearch() local
436 int badness = -pattern_length; in BoyerMooreHorspoolSearch()
439 PatternChar last_char = pattern[pattern_length - 1]; in BoyerMooreHorspoolSearch()
440 int last_char_shift = pattern_length - 1 - in BoyerMooreHorspoolSearch()
444 while (index <= subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
445 int j = pattern_length - 1; in BoyerMooreHorspoolSearch()
452 if (index > subject_length - pattern_length) { in BoyerMooreHorspoolSearch()
466 badness += (pattern_length - j) - last_char_shift; in BoyerMooreHorspoolSearch()
480 int pattern_length = pattern_.length(); in PopulateBoyerMooreHorspoolTable() local
499 for (int i = start; i < pattern_length - 1; i++) { in PopulateBoyerMooreHorspoolTable()
518 int pattern_length = pattern.length(); in InitialSearch() local
522 int badness = -10 - (pattern_length << 2); in InitialSearch()
526 for (int i = index, n = subject.length() - pattern_length; i <= n; i++) { in InitialSearch()
538 } while (j < pattern_length); in InitialSearch()
539 if (j == pattern_length) { in InitialSearch()