aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-10-06 18:34:40 +0100
committerMatthew Wild <mwild1@gmail.com>2022-10-06 18:34:40 +0100
commit08b49654d9bfd6a280e336d834f4bcfee8bda8e1 (patch)
treecdc96abc1ec24589163565d6192685d8ec79647a /util
parent12fc0febf172dd25d403af6365f3e5042b06d6dd (diff)
downloadprosody-08b49654d9bfd6a280e336d834f4bcfee8bda8e1.tar.gz
prosody-08b49654d9bfd6a280e336d834f4bcfee8bda8e1.zip
util.iterators: join: Work even with only a single iterator in the chain
Diffstat (limited to 'util')
-rw-r--r--util/iterators.lua3
1 files changed, 2 insertions, 1 deletions
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;