aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-07-11 19:15:24 +0200
committerKim Alvefur <zash@zash.se>2022-07-11 19:15:24 +0200
commitf8e73eba98a73e5d3dd14f73d7ce66e5503efbb4 (patch)
treeb2d824d9e86f21f6f9701a94dea3028b54110b20
parent5251c9b686fc7885c1213cc2580d66ebda2dda9b (diff)
downloadprosody-f8e73eba98a73e5d3dd14f73d7ce66e5503efbb4.tar.gz
prosody-f8e73eba98a73e5d3dd14f73d7ce66e5503efbb4.zip
compat: Use table.pack (there since Lua 5.2) over our util.table
Added in d278a770eddc avoid having to deal with its absence in Lua 5.1. No longer needed when Lua 5.1 support is dropped.
-rw-r--r--core/moduleapi.lua2
-rw-r--r--tools/modtrace.lua2
-rw-r--r--util/format.lua2
-rw-r--r--util/iterators.lua2
-rw-r--r--util/openmetrics.lua2
5 files changed, 5 insertions, 5 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 98474b27..36d82193 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -26,7 +26,7 @@ local error, setmetatable, type = error, setmetatable, type;
local ipairs, pairs, select = ipairs, pairs, select;
local tonumber, tostring = tonumber, tostring;
local require = require;
-local pack = table.pack or require "util.table".pack; -- table.pack is only in 5.2
+local pack = table.pack;
local unpack = table.unpack;
local prosody = prosody;
diff --git a/tools/modtrace.lua b/tools/modtrace.lua
index f31ce2d1..f1927077 100644
--- a/tools/modtrace.lua
+++ b/tools/modtrace.lua
@@ -8,7 +8,7 @@
-- local dbuffer = require "tools.modtrace".trace("util.dbuffer");
--
-local t_pack = require "util.table".pack;
+local t_pack = table.pack;
local serialize = require "util.serialization".serialize;
local unpack = table.unpack;
local set = require "util.set";
diff --git a/util/format.lua b/util/format.lua
index 35694271..203bdeab 100644
--- a/util/format.lua
+++ b/util/format.lua
@@ -7,7 +7,7 @@
local tostring = tostring;
local unpack = table.unpack;
-local pack = require "util.table".pack; -- TODO table.pack in 5.2+
+local pack = table.pack;
local valid_utf8 = require "util.encodings".utf8.valid;
local type = type;
local dump = require "util.serialization".new("debug");
diff --git a/util/iterators.lua b/util/iterators.lua
index e9f7c1b2..4529697a 100644
--- a/util/iterators.lua
+++ b/util/iterators.lua
@@ -13,7 +13,7 @@ local it = {};
local t_insert = table.insert;
local next = next;
local unpack = table.unpack;
-local pack = table.pack or require "util.table".pack;
+local pack = table.pack;
local type = type;
local table, setmetatable = table, setmetatable;
diff --git a/util/openmetrics.lua b/util/openmetrics.lua
index f451e504..8c77ffcd 100644
--- a/util/openmetrics.lua
+++ b/util/openmetrics.lua
@@ -26,7 +26,7 @@ local log = require "util.logger".init("util.openmetrics");
local new_multitable = require "util.multitable".new;
local iter_multitable = require "util.multitable".iter;
local t_concat, t_insert = table.concat, table.insert;
-local t_pack, t_unpack = require "util.table".pack, table.unpack;
+local t_pack, t_unpack = table.pack, table.unpack;
-- BEGIN of Utility: "metric proxy"
-- This allows to wrap a MetricFamily in a proxy which only provides the