- 'luaL_setfuncs' avoids creating closures for placeholders.
- Fixed some warnings about unused values in comma expressions.
- Comments.
This commit is contained in:
Roberto Ierusalimschy
2019-05-13 16:20:40 -03:00
parent 279c3a6961
commit 0b63d79b36
5 changed files with 13 additions and 11 deletions

View File

@@ -299,7 +299,7 @@ static IdxT partition (lua_State *L, IdxT lo, IdxT up) {
/* loop invariant: a[lo .. i] <= P <= a[j .. up] */
for (;;) {
/* next loop: repeat ++i while a[i] < P */
while (lua_geti(L, 1, ++i), sort_comp(L, -1, -2)) {
while ((void)lua_geti(L, 1, ++i), sort_comp(L, -1, -2)) {
if (i == up - 1) /* a[i] < P but a[up - 1] == P ?? */
luaL_error(L, "invalid order function for sorting");
lua_pop(L, 1); /* remove a[i] */