- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for makeStringFinder (0.61 sec)
-
src/strings/search.go
// rightmost "abc" (at position 6) is a prefix of the whole pattern, so // goodSuffixSkip[3] == shift+len(suffix) == 6+5 == 11. goodSuffixSkip []int } func makeStringFinder(pattern string) *stringFinder { f := &stringFinder{ pattern: pattern, goodSuffixSkip: make([]int, len(pattern)), } // last is the index of the last character in the pattern. last := len(pattern) - 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 07 18:49:51 UTC 2023 - 4.1K bytes - Viewed (0) -
src/strings/replace.go
// value is the new string that replaces that pattern when it's found. value string } func makeSingleStringReplacer(pattern string, value string) *singleStringReplacer { return &singleStringReplacer{finder: makeStringFinder(pattern), value: value} } func (r *singleStringReplacer) Replace(s string) string { var buf Builder i, matched := 0, false for { match := r.finder.next(s[i:]) if match == -1 { break
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 13 17:10:31 UTC 2023 - 14.5K bytes - Viewed (0)