util/queue.lua
changeset 9929 8d0112413997
parent 9906 3eea63a68e0f
child 9930 1bfd28e774db
--- a/util/queue.lua	Mon Mar 25 14:37:43 2019 +0000
+++ b/util/queue.lua	Tue Mar 26 13:51:06 2019 +0000
@@ -52,15 +52,16 @@
 			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)