MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / posrelat

Function posrelat

deps/lua/src/lstrlib.c:36–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {
37 /* relative string position: negative means back from end */
38 if (pos < 0) pos += (ptrdiff_t)len + 1;
39 return (pos >= 0) ? pos : 0;
40}
41
42
43static int str_sub (lua_State *L) {

Callers 3

str_subFunction · 0.85
str_byteFunction · 0.85
str_find_auxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected