summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r--indra/newview/scripts/lua/Queue.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/newview/scripts/lua/Queue.lua b/indra/newview/scripts/lua/Queue.lua
index fa8737334c..e178ad9969 100644
--- a/indra/newview/scripts/lua/Queue.lua
+++ b/indra/newview/scripts/lua/Queue.lua
@@ -2,29 +2,29 @@
local Queue = {}
Queue.__index = Queue
-​
+
function Queue.new()
local self = setmetatable({}, Queue)
-​
+
self._first = 0
self._last = -1
self._queue = {}
-​
+
return self
end
-​
+
-- Check if the queue is empty
function Queue:IsEmpty()
return self._first > self._last
end
-​
+
-- Add a value to the queue
function Queue:Enqueue(value)
local last = self._last + 1
self._last = last
self._queue[last] = value
end
-​
+
-- Remove a value from the queue
function Queue:Dequeue()
local first = self._first
@@ -36,5 +36,5 @@ function Queue:Dequeue()
self._first = first + 1
return value
end
-​
+
return Queue