aboutsummaryrefslogtreecommitdiffstats
path: root/util/queue.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2019-03-26 13:51:06 +0000
committerMatthew Wild <mwild1@gmail.com>2019-03-26 13:51:06 +0000
commit08ec4600470e32bbc4bb0afdfce9012f6a8cb5e9 (patch)
tree11c0f79986e893ea87243cf64d828f22dea01b16 /util/queue.lua
parente9eca8cd5521f2bfc8f9285b606eb84de5a467e4 (diff)
downloadprosody-08ec4600470e32bbc4bb0afdfce9012f6a8cb5e9.tar.gz
prosody-08ec4600470e32bbc4bb0afdfce9012f6a8cb5e9.zip
Backed out changeset 3eea63a68e0f
Commit included intended changes to loggingmanager
Diffstat (limited to 'util/queue.lua')
-rw-r--r--util/queue.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/util/queue.lua b/util/queue.lua
index 66ed098b..e63b3f1c 100644
--- a/util/queue.lua
+++ b/util/queue.lua
@@ -52,15 +52,16 @@ local function new(size, allow_wrapping)
return t[tail];
end;
items = function (self)
- return function (_, pos)
- if pos >= items then
+ --luacheck: ignore 431/t
+ return function (t, pos)
+ if pos >= t:count() then
return nil;
end
local read_pos = tail + pos;
- if read_pos > self.size then
+ if read_pos > t.size then
read_pos = (read_pos%size);
end
- return pos+1, t[read_pos];
+ return pos+1, t._items[read_pos];
end, self, 0;
end;
consume = function (self)