util-src/table.c
changeset 12579 1f6f05a98fcd
parent 12409 308ed64dc69b
child 12595 494577d883ff
--- a/util-src/table.c	Sat Jul 02 17:30:06 2022 +0200
+++ b/util-src/table.c	Fri Jul 01 21:21:21 2022 +0200
@@ -6,10 +6,6 @@
 #define LUA_MAXINTEGER PTRDIFF_MAX
 #endif
 
-#if (LUA_VERSION_NUM > 501)
-#define lua_equal(L, A, B) lua_compare(L, A, B, LUA_OPEQ)
-#endif
-
 static int Lcreate_table(lua_State *L) {
 	lua_createtable(L, luaL_checkinteger(L, 1), luaL_checkinteger(L, 2));
 	return 1;
@@ -47,7 +43,7 @@
 		n = e - f + 1;  /* number of elements to move */
 		luaL_argcheck(L, t <= LUA_MAXINTEGER - n + 1, 4,
 		"destination wrap around");
-		if (t > e || t <= f || (tt != 1 && !lua_equal(L, 1, tt))) {
+		if (t > e || t <= f || (tt != 1 && !lua_compare(L, 1, tt, LUA_OPEQ))) {
 			for (i = 0; i < n; i++) {
 				lua_rawgeti(L, 1, f + i);
 				lua_rawseti(L, tt, t + i);
@@ -65,9 +61,7 @@
 }
 
 int luaopen_util_table(lua_State *L) {
-#if (LUA_VERSION_NUM > 501)
 	luaL_checkversion(L);
-#endif
 	lua_createtable(L, 0, 2);
 	lua_pushcfunction(L, Lcreate_table);
 	lua_setfield(L, -2, "create");