Still porting to lua 5.2

This commit is contained in:
2021-02-28 14:45:09 -05:00
parent 23ae577fbb
commit 5760078208
3 changed files with 9 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ LuaDefine(table_equal, "c") {
while (lua_next(L, t1.index()) != 0) {
lua_pushvalue(L, -2); // k v1 k
lua_rawget(L, t2.index()); // k v1 v2
if (!lua_equal(L, -1, -2)) {
if (!lua_rawequal(L, -1, -2)) {
LS.set(eql, false);
return LS.result();
}
@@ -36,7 +36,7 @@ LuaDefine(table_findremove, "c") {
while (true) {
lua_pushinteger(L, src);
lua_rawget(L, -3);
if (lua_equal(L, -1, -2)) {
if (lua_rawequal(L, -1, -2)) {
src++;
lua_pop(L, 1);
} else if (lua_isnil(L, -1)) {
@@ -68,7 +68,7 @@ LuaDefine(table_findremove, "c") {
LuaDefine(table_push, "c") {
luaL_checktype(L, -2, LUA_TTABLE);
int len = lua_objlen(L, -2);
int len = lua_rawlen(L, -2);
lua_pushinteger(L, len+1);
lua_pushvalue(L, -2);
lua_rawset(L, -4);
@@ -81,7 +81,7 @@ LuaDefine(table_find, "c") {
for (int i = 1; ; i++) {
lua_pushinteger(L, i);
lua_rawget(L, -3);
if (lua_equal(L, -1, -2)) {
if (lua_rawequal(L, -1, -2)) {
lua_pop(L, 3);
lua_pushinteger(L, i);
return 1;