MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaB_select

Function luaB_select

ThirdParty/lua/lua/lbaselib.c:401–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399
400
401static int luaB_select (lua_State *L) {
402 int n = lua_gettop(L);
403 if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {
404 lua_pushinteger(L, n-1);
405 return 1;
406 }
407 else {
408 lua_Integer i = luaL_checkinteger(L, 1);
409 if (i < 0) i = n + i;
410 else if (i > n) i = n;
411 luaL_argcheck(L, 1 <= i, 1, "index out of range");
412 return n - (int)i;
413 }
414}
415
416
417/*

Callers

nothing calls this directly

Calls 4

lua_gettopFunction · 0.85
lua_typeFunction · 0.85
lua_pushintegerFunction · 0.85
luaL_checkintegerFunction · 0.85

Tested by

no test coverage detected