MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / sort

Function sort

Dependencies/lua/src/ltablib.c:399–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397
398
399static int sort (lua_State *L) {
400 lua_Integer n = aux_getn(L, 1, TAB_RW);
401 if (n > 1) { /* non-trivial interval? */
402 luaL_argcheck(L, n < INT_MAX, 1, "array too big");
403 if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */
404 luaL_checktype(L, 2, LUA_TFUNCTION); /* must be a function */
405 lua_settop(L, 2); /* make sure there are two arguments */
406 auxsort(L, 1, (IdxT)n, 0);
407 }
408 return 0;
409}
410
411/* }====================================================== */
412

Callers 6

ParseFolderMethod · 0.50
RefreshMethod · 0.50
InitCallstackFunction · 0.50
InitKernelSymbolsFunction · 0.50
KCoreMethod · 0.50

Calls 3

luaL_checktypeFunction · 0.85
lua_settopFunction · 0.85
auxsortFunction · 0.85

Tested by

no test coverage detected