MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / sort

Function sort

lib/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 15

quazip_sortFunction · 0.85
baudRateListMethod · 0.85
enumerateDevicesMethod · 0.85
extractCapabilitiesFunction · 0.85
searchMethod · 0.85
listCategoriesMethod · 0.85
emitPendingToolCallsMethod · 0.85
appendBucketSamplesFunction · 0.85
writeReportSamplesFunction · 0.85
alignColumnsToProjectMethod · 0.85

Calls 3

luaL_checktypeFunction · 0.85
lua_settopFunction · 0.85
auxsortFunction · 0.85

Tested by

no test coverage detected