From 03c16a23abd1a0fde7a6033b419e9c0132481c4a Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Sat, 19 Dec 2009 02:29:34 -0600 Subject: [PATCH] Fixed the order of several lists (changed several pairs to ipairs) --- Regexps.lua | 4 ++-- WeightsWatcher.lua | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) 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) -- 1.7.9.5