Quantcast

Size() method returns the size/length of a queue.

Johnny C. Lam [08-10-13 - 18:38]
Size() method returns the size/length of a queue.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@992 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleQueue.lua
diff --git a/OvaleQueue.lua b/OvaleQueue.lua
index ce0c570..ad421ee 100644
--- a/OvaleQueue.lua
+++ b/OvaleQueue.lua
@@ -99,8 +99,12 @@ function OvaleQueue:Reset()
 	self.last = -1
 end

+function OvaleQueue:Size()
+	return self.last - self.first + 1
+end
+
 function OvaleQueue:Debug()
-	Ovale:FormatPrint("Queue %s has %d item(s), first=%d, last=%d.", self.name, self.last - self.first + 1, self.first, self.last)
+	Ovale:FormatPrint("Queue %s has %d item(s), first=%d, last=%d.", self.name, self:Size(), self.first, self.last)
 end
 --</public-static-methods>