| 409 | |
| 410 | |
| 411 | static int sort (lua_State *L) { |
| 412 | lua_Integer n = aux_getn(L, 1, TAB_RW); |
| 413 | if (n > 1) { /* non-trivial interval? */ |
| 414 | luaL_argcheck(L, n < INT_MAX, 1, "array too big"); |
| 415 | if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ |
| 416 | luaL_checktype(L, 2, LUA_TFUNCTION); /* must be a function */ |
| 417 | lua_settop(L, 2); /* make sure there are two arguments */ |
| 418 | auxsort(L, 1, (IdxT)n, 0); |
| 419 | } |
| 420 | return 0; |
| 421 | } |
| 422 | |
| 423 | /* }====================================================== */ |
| 424 |
nothing calls this directly
no test coverage detected