From a2c0f6d6458193baa67e1df44a9c94fec357011b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 22 Feb 2016 17:38:46 +0100 Subject: util.iterators: Localize unpack() in Lua 5.2 compatible way --- util/iterators.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/iterators.lua') diff --git a/util/iterators.lua b/util/iterators.lua index aa9c3ec0..e688980b 100644 --- a/util/iterators.lua +++ b/util/iterators.lua @@ -11,7 +11,8 @@ local it = {}; local t_insert = table.insert; -local select, unpack, next = select, unpack, next; +local select, next = select, next; +local unpack = table.unpack or unpack; --luacheck: ignore 113 local function pack(...) return { n = select("#", ...), ... }; end -- Reverse an iterator -- cgit v1.2.3 From 11ebf4f1dc56644712e12e451e9b37c472c69238 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 22 Feb 2016 17:43:40 +0100 Subject: util.iterators: Use table.pack() on Lua 5.2 --- util/iterators.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/iterators.lua') diff --git a/util/iterators.lua b/util/iterators.lua index e688980b..868ba786 100644 --- a/util/iterators.lua +++ b/util/iterators.lua @@ -13,7 +13,7 @@ local it = {}; local t_insert = table.insert; local select, next = select, next; local unpack = table.unpack or unpack; --luacheck: ignore 113 -local function pack(...) return { n = select("#", ...), ... }; end +local pack = table.pack or function (...) return { n = select("#", ...), ... }; end -- Reverse an iterator function it.reverse(f, s, var) -- cgit v1.2.3