MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / sort

Function sort

third-party/lua-5.2.4/src/ltablib.c:249–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249static int sort (lua_State *L) {
250 int n = aux_getn(L, 1);
251 luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */
252 if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */
253 luaL_checktype(L, 2, LUA_TFUNCTION);
254 lua_settop(L, 2); /* make sure there is two arguments */
255 auxsort(L, 1, n);
256 return 0;
257}
258
259/* }====================================================== */
260

Callers

nothing calls this directly

Calls 4

luaL_checkstackFunction · 0.70
luaL_checktypeFunction · 0.70
lua_settopFunction · 0.70
auxsortFunction · 0.70

Tested by

no test coverage detected