diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-09-30 09:46:30 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-09-30 09:46:30 +0100 |
commit | f5f2a709cddd5822443011787cbdee0ba4480cf4 (patch) | |
tree | 7fe87d3d82e0aeca9aee079e9c3325a4a074a660 /util/queue.lua | |
parent | 80beeeb187e84bda89cfe7390704f6a53406cad6 (diff) | |
parent | a481251b29a745556bcb9a32786f3ccd02ad7102 (diff) | |
download | prosody-f5f2a709cddd5822443011787cbdee0ba4480cf4.tar.gz prosody-f5f2a709cddd5822443011787cbdee0ba4480cf4.zip |
Merge
Diffstat (limited to 'util/queue.lua')
-rw-r--r-- | util/queue.lua | 7 |
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) |