From de724221378ba5772c9cfdb2d40c43619da8166f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 26 Mar 2019 13:51:06 +0000 Subject: Backed out changeset 3eea63a68e0f Commit included intended changes to loggingmanager --- util/queue.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'util/queue.lua') 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) -- cgit v1.2.3