MCPcopy Index your code
hub / github.com/yuin/gopher-lua / luaIndex2StringIndex

Function luaIndex2StringIndex

stringlib.go:433–446  ·  view source on GitHub ↗
(str string, i int, start bool)

Source from the content-addressed store, hash-verified

431}
432
433func luaIndex2StringIndex(str string, i int, start bool) int {
434 if start && i != 0 {
435 i -= 1
436 }
437 l := len(str)
438 if i < 0 {
439 i = l + i + 1
440 }
441 i = intMax(0, i)
442 if !start && i > l {
443 i = l
444 }
445 return i
446}
447
448//

Callers 2

strFindFunction · 0.85
strSubFunction · 0.85

Calls 1

intMaxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…