# HG changeset patch # User Kim Alvefur # Date 1544283339 -3600 # Node ID 8c92ef4270c9c9b1cf1dc175041c024fd8d60cf8 # Parent e52e4e6e7ffb02bf63c7b78070eb99a5d00e9fdc util.format: Use pack from util.table diff -r e52e4e6e7ffb -r 8c92ef4270c9 util/format.lua --- a/util/format.lua Sat Dec 08 16:35:00 2018 +0100 +++ b/util/format.lua Sat Dec 08 16:35:39 2018 +0100 @@ -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: '%%'