aboutsummaryrefslogtreecommitdiffstats
path: root/util/queue.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/queue.lua')
-rw-r--r--util/queue.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/queue.lua b/util/queue.lua
index 66ed098b..c94c62ae 100644
--- a/util/queue.lua
+++ b/util/queue.lua
@@ -51,6 +51,13 @@ local function new(size, allow_wrapping)
end
return t[tail];
end;
+ replace = function (self, data)
+ if items == 0 then
+ return self:push(data);
+ end
+ t[tail] = data;
+ return true;
+ end;
items = function (self)
return function (_, pos)
if pos >= items then