# HG changeset patch # User Kim Alvefur # Date 1657559724 -7200 # Node ID 5eaf77114fdba5b8bfb226bb2e88a9c61c7f5e53 # Parent 39ae08180c81200b3a712822b37b924b93126bdf 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. diff -r 39ae08180c81 -r 5eaf77114fdb core/moduleapi.lua --- a/core/moduleapi.lua Mon Jul 11 19:07:38 2022 +0200 +++ b/core/moduleapi.lua Mon Jul 11 19:15:24 2022 +0200 @@ -26,7 +26,7 @@ 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 -r 39ae08180c81 -r 5eaf77114fdb tools/modtrace.lua --- a/tools/modtrace.lua Mon Jul 11 19:07:38 2022 +0200 +++ b/tools/modtrace.lua Mon Jul 11 19:15:24 2022 +0200 @@ -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 -r 39ae08180c81 -r 5eaf77114fdb util/format.lua --- a/util/format.lua Mon Jul 11 19:07:38 2022 +0200 +++ b/util/format.lua Mon Jul 11 19:15:24 2022 +0200 @@ -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 -r 39ae08180c81 -r 5eaf77114fdb util/iterators.lua --- a/util/iterators.lua Mon Jul 11 19:07:38 2022 +0200 +++ b/util/iterators.lua Mon Jul 11 19:15:24 2022 +0200 @@ -13,7 +13,7 @@ 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 -r 39ae08180c81 -r 5eaf77114fdb util/openmetrics.lua --- a/util/openmetrics.lua Mon Jul 11 19:07:38 2022 +0200 +++ b/util/openmetrics.lua Mon Jul 11 19:15:24 2022 +0200 @@ -26,7 +26,7 @@ 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