aboutsummaryrefslogtreecommitdiffstats
path: root/util/format.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-08 16:35:39 +0100
committerKim Alvefur <zash@zash.se>2018-12-08 16:35:39 +0100
commit01deb521fd669fab333f5af103f176122fa225e2 (patch)
tree9281a9058cce0690a9d5abca724756f512ca26c8 /util/format.lua
parentc899c8d357a046e72d4e88c2e05a893c34af2650 (diff)
downloadprosody-01deb521fd669fab333f5af103f176122fa225e2.tar.gz
prosody-01deb521fd669fab333f5af103f176122fa225e2.zip
util.format: Use pack from util.table
Diffstat (limited to 'util/format.lua')
-rw-r--r--util/format.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/format.lua b/util/format.lua
index 16c57bc6..6c46384a 100644
--- a/util/format.lua
+++ b/util/format.lua
@@ -3,12 +3,13 @@
--
local tostring = tostring;
-local select = select;
local unpack = table.unpack or unpack; -- luacheck: ignore 113/unpack
+local pack = require "util.table".pack; -- TODO table.pack in 5.2+
local type = type;
local function format(formatstring, ...)
- local args, args_length = { ... }, select('#', ...);
+ local args = pack(...);
+ local args_length = args.n;
-- format specifier spec:
-- 1. Start: '%%'