mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
util.format: Use pack from util.table
This commit is contained in:
parent
c899c8d357
commit
01deb521fd
1 changed files with 3 additions and 2 deletions
|
@ -3,12 +3,13 @@
|
||||||
--
|
--
|
||||||
|
|
||||||
local tostring = tostring;
|
local tostring = tostring;
|
||||||
local select = select;
|
|
||||||
local unpack = table.unpack or unpack; -- luacheck: ignore 113/unpack
|
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 type = type;
|
||||||
|
|
||||||
local function format(formatstring, ...)
|
local function format(formatstring, ...)
|
||||||
local args, args_length = { ... }, select('#', ...);
|
local args = pack(...);
|
||||||
|
local args_length = args.n;
|
||||||
|
|
||||||
-- format specifier spec:
|
-- format specifier spec:
|
||||||
-- 1. Start: '%%'
|
-- 1. Start: '%%'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue