Quantcast

Use next instead of pairs

Adrian L Lange [07-22-14 - 05:48]
Use next instead of pairs
Filename
Lockpicking.lua
Molinari.lua
diff --git a/Lockpicking.lua b/Lockpicking.lua
index 4b3b022..0115829 100644
--- a/Lockpicking.lua
+++ b/Lockpicking.lua
@@ -51,7 +51,7 @@ local keys = {
 }

 function ns.SkeletonKey()
-	for key in pairs(keys) do
+	for key in next, keys do
 		if(GetItemCount(key) > 0) then
 			return key
 		end
diff --git a/Molinari.lua b/Molinari.lua
index d2decc8..f0f4178 100644
--- a/Molinari.lua
+++ b/Molinari.lua
@@ -10,7 +10,7 @@ local function ParentClick(self, button, ...)
 	if(button ~= 'LeftButton') then
 		local _, parent = self:GetPoint()
 		if(parent) then
-			for _, script in pairs(scripts) do
+			for _, script in next, scripts do
 				local handler = parent:GetScript(script)
 				if(handler) then
 					handler(parent, button, ...)
@@ -85,7 +85,7 @@ function button:PLAYER_LOGIN()
 	self:RegisterEvent('MODIFIER_STATE_CHANGED')
 	self:Hide()

-	for _, sparks in pairs(self.sparkles) do
+	for _, sparks in next, self.sparkles do
 		sparks:SetHeight(sparks:GetHeight() * 3)
 		sparks:SetWidth(sparks:GetWidth() * 3)
 	end