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