File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1100,11 +1100,11 @@ func Index(s, sep []byte) int {
1100
1100
if s [i ] != c0 {
1101
1101
// IndexByte is faster than bytealg.Index, so use it as long as
1102
1102
// we're not getting lots of false positives.
1103
- o := IndexByte (s [i :t ], c0 )
1103
+ o := IndexByte (s [i + 1 :t ], c0 )
1104
1104
if o < 0 {
1105
1105
return - 1
1106
1106
}
1107
- i += o
1107
+ i += o + 1
1108
1108
}
1109
1109
if s [i + 1 ] == c1 && Equal (s [i :i + n ], sep ) {
1110
1110
return i
@@ -1129,11 +1129,11 @@ func Index(s, sep []byte) int {
1129
1129
t := len (s ) - n + 1
1130
1130
for i < t {
1131
1131
if s [i ] != c0 {
1132
- o := IndexByte (s [i :t ], c0 )
1132
+ o := IndexByte (s [i + 1 :t ], c0 )
1133
1133
if o < 0 {
1134
1134
break
1135
1135
}
1136
- i += o
1136
+ i += o + 1
1137
1137
}
1138
1138
if s [i + 1 ] == c1 && Equal (s [i :i + n ], sep ) {
1139
1139
return i
You can’t perform that action at this time.
0 commit comments