MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / sort

Function sort

extlibs/lua/src/ltablib.c:397–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 8

sortByDistanceFunction · 0.85
SortMethod · 0.85
sortElementsMethod · 0.85
convexHullFunction · 0.85
reorganizeLayersMethod · 0.85
resampleFunction · 0.85
setTagsFunction · 0.85
sortTestsFunction · 0.85

Calls 3

luaL_checktypeFunction · 0.85
lua_settopFunction · 0.85
auxsortFunction · 0.85

Tested by

no test coverage detected