Change-Id: I5a47b18b64e7f781dcc77440b06de36966e3d01d
GitHub-Last-Rev:
8576f1931d6e87a0823632ee35fcbc0d4eaaeaaf
GitHub-Pull-Request: golang/go#37993
Reviewed-on: https://go-review.googlesource.com/c/go/+/224589
Reviewed-by: Ian Lance Taylor <iant@golang.org>
if s[i] != c0 {
// IndexByte is faster than bytealg.Index, so use it as long as
// we're not getting lots of false positives.
- o := IndexByte(s[i:t], c0)
+ o := IndexByte(s[i+1:t], c0)
if o < 0 {
return -1
}
- i += o
+ i += o + 1
}
if s[i+1] == c1 && Equal(s[i:i+n], sep) {
return i
t := len(s) - n + 1
for i < t {
if s[i] != c0 {
- o := IndexByte(s[i:t], c0)
+ o := IndexByte(s[i+1:t], c0)
if o < 0 {
break
}
- i += o
+ i += o + 1
}
if s[i+1] == c1 && Equal(s[i:i+n], sep) {
return i