MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaB_select

Function luaB_select

app/redis-6.2.6/deps/lua/src/lbaselib.c:359–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.70
lua_typeFunction · 0.70
lua_pushintegerFunction · 0.70

Tested by

no test coverage detected