Quantcast

Fixed the order of several lists (changed several pairs to ipairs)

Kevin Lyles [12-19-09 - 08:29]
Fixed the order of several lists (changed several pairs to ipairs)
Filename
Regexps.lua
WeightsWatcher.lua
diff --git a/Regexps.lua b/Regexps.lua
index b8d9bee..34f9a00 100644
--- a/Regexps.lua
+++ b/Regexps.lua
@@ -163,7 +163,7 @@ function WeightsWatcher:multipleStats(text)
 		text = string.gsub(string.gsub(text, ",? and ", "\a"), ", ", "\a")
 	end
 	stringTable = { strsplit("\a", text) }
-	for _, statString in pairs(stringTable) do
+	for _, statString in ipairs(stringTable) do
 		stat = WeightsWatcher:singleStat(statString)
 		if stat then
 			stats = stats + stat
@@ -200,7 +200,7 @@ end

 function WeightsWatcher:singleStat(text)
 	local stat
-	for _, regex in pairs(SingleStatLines) do
+	for _, regex in ipairs(SingleStatLines) do
 		if type(regex) == "table" then
 			local pattern, func = unpack(regex)
 			if string.find(text, pattern) then
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index cc7dfcc..51c5b71 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -778,7 +778,7 @@ function WeightsWatcher:getItemStats(link)
 			socketBonusStat = WeightsWatcher:singleStat(value)
 		end
 		if not matched then
-			for _, regex in pairs(SocketLines) do
+			for _, regex in ipairs(SocketLines) do
 				start, _, value = string.find(textL, regex)
 				if start then
 					matched = true
@@ -787,14 +787,14 @@ function WeightsWatcher:getItemStats(link)
 				end
 			end
 			if not matched then
-				for _, regex in pairs(IgnoredLines) do
+				for _, regex in ipairs(IgnoredLines) do
 					if string.find(textL, regex) then
 						matched = true
 						break
 					end
 				end
 				if not matched then
-					for _, regex in pairs(DoubleSlotLines) do
+					for _, regex in ipairs(DoubleSlotLines) do
 						if string.find(textL, regex) then
 							matched = true
 							normalStats["Slot"] =  textL
@@ -806,7 +806,7 @@ function WeightsWatcher:getItemStats(link)
 						end
 					end
 					if not matched then
-						for _, regex in pairs(SingleSlotLines) do
+						for _, regex in ipairs(SingleSlotLines) do
 							if string.find(textL, regex) then
 								matched = true
 								normalStats["Slot"] =  textL
@@ -814,7 +814,7 @@ function WeightsWatcher:getItemStats(link)
 							end
 						end
 						if not matched then
-							for _, regex in pairs(MultipleStatLines) do
+							for _, regex in ipairs(MultipleStatLines) do
 								pattern, func = unpack(regex)
 								if string.find(textL, pattern) then
 									statsList = func(textL, textR)