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.
This commit is contained in:
Kim Alvefur 2022-07-11 19:15:24 +02:00
parent 5251c9b686
commit f8e73eba98
5 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ local error, setmetatable, type = error, setmetatable, type;
local ipairs, pairs, select = ipairs, pairs, select; local ipairs, pairs, select = ipairs, pairs, select;
local tonumber, tostring = tonumber, tostring; local tonumber, tostring = tonumber, tostring;
local require = require; 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 unpack = table.unpack;
local prosody = prosody; local prosody = prosody;

View file

@ -8,7 +8,7 @@
-- local dbuffer = require "tools.modtrace".trace("util.dbuffer"); -- 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 serialize = require "util.serialization".serialize;
local unpack = table.unpack; local unpack = table.unpack;
local set = require "util.set"; local set = require "util.set";

View file

@ -7,7 +7,7 @@
local tostring = tostring; local tostring = tostring;
local unpack = table.unpack; 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 valid_utf8 = require "util.encodings".utf8.valid;
local type = type; local type = type;
local dump = require "util.serialization".new("debug"); local dump = require "util.serialization".new("debug");

View file

@ -13,7 +13,7 @@ local it = {};
local t_insert = table.insert; local t_insert = table.insert;
local next = next; local next = next;
local unpack = table.unpack; local unpack = table.unpack;
local pack = table.pack or require "util.table".pack; local pack = table.pack;
local type = type; local type = type;
local table, setmetatable = table, setmetatable; local table, setmetatable = table, setmetatable;

View file

@ -26,7 +26,7 @@ local log = require "util.logger".init("util.openmetrics");
local new_multitable = require "util.multitable".new; local new_multitable = require "util.multitable".new;
local iter_multitable = require "util.multitable".iter; local iter_multitable = require "util.multitable".iter;
local t_concat, t_insert = table.concat, table.insert; 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" -- BEGIN of Utility: "metric proxy"
-- This allows to wrap a MetricFamily in a proxy which only provides the -- This allows to wrap a MetricFamily in a proxy which only provides the