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 | 75a555dea1f6fd0c8d455693c5b838b7f52ac35a (patch) | |
tree | 7fe87d3d82e0aeca9aee079e9c3325a4a074a660 /util/queue.lua | |
parent | 403c051a217c0df715df8f51c4f39947fad0f65e (diff) | |
parent | 11ef94449fefbe3ab60719a2054bbbb0b7178f6f (diff) | |
download | prosody-75a555dea1f6fd0c8d455693c5b838b7f52ac35a.tar.gz prosody-75a555dea1f6fd0c8d455693c5b838b7f52ac35a.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) |