aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/table.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-07-01 21:21:21 +0200
committerKim Alvefur <zash@zash.se>2022-07-01 21:21:21 +0200
commitdff4beae0278ae5b98c52b7e1162ceb318236256 (patch)
tree39114742a01c88d240aaefd0d9b484a1581ef459 /util-src/table.c
parent2ec8fbe7e5f571727a14205a7389f6528112a133 (diff)
downloadprosody-dff4beae0278ae5b98c52b7e1162ceb318236256.tar.gz
prosody-dff4beae0278ae5b98c52b7e1162ceb318236256.zip
util-src: Remove Lua 5.1 compat macros
Part of #1600
Diffstat (limited to 'util-src/table.c')
-rw-r--r--util-src/table.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/util-src/table.c b/util-src/table.c
index 4bbceedb..ade019c4 100644
--- a/util-src/table.c
+++ b/util-src/table.c
@@ -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 @@ static int Lmove (lua_State *L) {
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 @@ static int Lmove (lua_State *L) {
}
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");