(input string, startAt, byteIndex, distance int)
| 382 | } |
| 383 | |
| 384 | func stringFixedDistanceCandidateStart(input string, startAt, byteIndex, distance int) (int, bool) { |
| 385 | candidateByteIndex := byteIndex |
| 386 | for i := 0; i < distance; i++ { |
| 387 | if candidateByteIndex <= startAt { |
| 388 | return 0, false |
| 389 | } |
| 390 | _, size := utf8.DecodeLastRuneInString(input[:candidateByteIndex]) |
| 391 | if size == 0 { |
| 392 | return 0, false |
| 393 | } |
| 394 | candidateByteIndex -= size |
| 395 | } |
| 396 | return candidateByteIndex, true |
| 397 | } |
| 398 | |
| 399 | func (re *Regexp) findStringPrefixCandidate(input string, startAt int) (candidateByteIndex int, ok bool) { |
| 400 | if re.stringPrefixFilter == nil || re.RightToLeft() { |
no outgoing calls
no test coverage detected