diff options
author | Kim Alvefur <zash@zash.se> | 2018-12-08 16:35:39 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-12-08 16:35:39 +0100 |
commit | 01deb521fd669fab333f5af103f176122fa225e2 (patch) | |
tree | 9281a9058cce0690a9d5abca724756f512ca26c8 /util | |
parent | c899c8d357a046e72d4e88c2e05a893c34af2650 (diff) | |
download | prosody-01deb521fd669fab333f5af103f176122fa225e2.tar.gz prosody-01deb521fd669fab333f5af103f176122fa225e2.zip |
util.format: Use pack from util.table
Diffstat (limited to 'util')
-rw-r--r-- | util/format.lua | 5 |
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: '%%' |