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

Function sort

deps/lua/src/ltablib.c:256–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256static int sort (lua_State *L) {
257 int n = aux_getn(L, 1);
258 luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */
259 if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */
260 luaL_checktype(L, 2, LUA_TFUNCTION);
261 lua_settop(L, 2); /* make sure there is two arguments */
262 auxsort(L, 1, n);
263 return 0;
264}
265
266/* }====================================================== */
267

Callers 2

TEST_FFunction · 0.85
getMetricsMethod · 0.85

Calls 4

luaL_checkstackFunction · 0.85
luaL_checktypeFunction · 0.85
lua_settopFunction · 0.85
auxsortFunction · 0.85

Tested by 2

TEST_FFunction · 0.68
getMetricsMethod · 0.68