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
commit4051f5e653a65d4edd360a32b5dac9e231b02a99 (patch)
tree7fe87d3d82e0aeca9aee079e9c3325a4a074a660 /util/queue.lua
parent771534a2e4f8a272e79d10d0f8509ab8c62a88d5 (diff)
parent1b29c3c9f98113946e242885a99a595ab9da5b56 (diff)
downloadprosody-4051f5e653a65d4edd360a32b5dac9e231b02a99.tar.gz
prosody-4051f5e653a65d4edd360a32b5dac9e231b02a99.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)