MCPcopy Create free account
hub / github.com/dlclark/regexp2 / byteIndex

Method byteIndex

regexp.go:412–420  ·  view source on GitHub ↗
(runeIndex int)

Source from the content-addressed store, hash-verified

410}
411
412func (m *stringByteMapper) byteIndex(runeIndex int) int {
413 i := sort.Search(len(m.runeIndexes), func(i int) bool {
414 return m.runeIndexes[i] > runeIndex
415 }) - 1
416 if i < 0 {
417 return runeIndex
418 }
419 return runeIndex + m.deltas[i]
420}
421
422// FindNextMatch returns the next match in the same input string as the match parameter.
423// Will return nil if there is no next match or if given a nil match.

Callers 1

FindAllStringIndexMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected