From 08b49654d9bfd6a280e336d834f4bcfee8bda8e1 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 6 Oct 2022 18:34:40 +0100 Subject: util.iterators: join: Work even with only a single iterator in the chain --- 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 4529697a..eb4c54af 100644 --- a/util/iterators.lua +++ b/util/iterators.lua @@ -240,7 +240,8 @@ function join_methods:prepend(f, s, var) end function it.join(f, s, var) - return setmetatable({ {f, s, var} }, join_mt); + local t = setmetatable({ {f, s, var} }, join_mt); + return t, { t, 1 }; end return it; -- cgit v1.2.3