aboutsummaryrefslogtreecommitdiffstats
path: root/util/queue.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-30 09:46:30 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-30 09:46:30 +0100
commitf5f2a709cddd5822443011787cbdee0ba4480cf4 (patch)
tree7fe87d3d82e0aeca9aee079e9c3325a4a074a660 /util/queue.lua
parent80beeeb187e84bda89cfe7390704f6a53406cad6 (diff)
parenta481251b29a745556bcb9a32786f3ccd02ad7102 (diff)
downloadprosody-f5f2a709cddd5822443011787cbdee0ba4480cf4.tar.gz
prosody-f5f2a709cddd5822443011787cbdee0ba4480cf4.zip
Merge
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 728e905f..c8e71514 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)
--luacheck: ignore 431/t
return function (t, pos)