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

Function luaB_select

deps/lua/src/lbaselib.c:358–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356
357
358static int luaB_select (lua_State *L) {
359 int n = lua_gettop(L);
360 if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
361 lua_pushinteger(L, n-1);
362 return 1;
363 }
364 else {
365 int i = luaL_checkint(L, 1);
366 if (i < 0) i = n + i;
367 else if (i > n) i = n;
368 luaL_argcheck(L, 1 <= i, 1, "index out of range");
369 return n - i;
370 }
371}
372
373
374static int luaB_pcall (lua_State *L) {

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
lua_typeFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected