Mercurial > prosody-hg
comparison util/iterators.lua @ 9688:eade1316728e
util.iterators: Use pack from table.pack
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 08 Dec 2018 16:36:05 +0100 |
| parents | f6f1dec164b5 |
| children | 39ae08180c81 |
comparison
equal
deleted
inserted
replaced
| 9687:8c92ef4270c9 | 9688:eade1316728e |
|---|---|
| 9 --[[ Iterators ]]-- | 9 --[[ Iterators ]]-- |
| 10 | 10 |
| 11 local it = {}; | 11 local it = {}; |
| 12 | 12 |
| 13 local t_insert = table.insert; | 13 local t_insert = table.insert; |
| 14 local select, next = select, next; | 14 local next = next; |
| 15 local unpack = table.unpack or unpack; --luacheck: ignore 113 143 | 15 local unpack = table.unpack or unpack; --luacheck: ignore 113 |
| 16 local pack = table.pack or function (...) return { n = select("#", ...), ... }; end -- luacheck: ignore 143 | 16 local pack = table.pack or require "util.table".pack; |
| 17 local type = type; | 17 local type = type; |
| 18 local table, setmetatable = table, setmetatable; | 18 local table, setmetatable = table, setmetatable; |
| 19 | 19 |
| 20 local _ENV = nil; | 20 local _ENV = nil; |
| 21 --luacheck: std none | 21 --luacheck: std none |
