cleanup: use plain string.find where possible

This commit is contained in:
shagu
2017-01-02 00:41:47 +01:00
parent 2f22f9e4a2
commit cc0c086ca2
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -93,8 +93,8 @@ pfUI:RegisterModule("autoshift", function ()
currBuffTex = GetPlayerBuffTexture(i)
if (currBuffTex) then
for id, bufftype in pairs(pfUI.autoshift.buffs) do
if string.find(string.lower(currBuffTex), bufftype) then
if string.find(string.lower(currBuffTex), "spell_shadow_shadowform") then
if string.find(string.lower(currBuffTex), bufftype, 1) then
if string.find(string.lower(currBuffTex), "spell_shadow_shadowform", 1) then
CancelLater = i
else
CancelPlayerBuff(i)
+1 -1
View File
@@ -554,7 +554,7 @@ pfUI:RegisterModule("chat", function ()
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
-- make incoming whispers lighter than outgoing
if string.find(text, '|cff'..wcol) == 1 then
if string.find(text, '|cff'..wcol, 1) == 1 then
text = string.gsub(text, "|r", "|cff" .. wcol)
end
+3 -3
View File
@@ -204,11 +204,11 @@ pfUI:RegisterModule("nameplates", function ()
-- show indicator for elite/rare mobs
if level:GetText() ~= nil then
if pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "elite" and not string.find(level:GetText(), "+") then
if pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "elite" and not string.find(level:GetText(), "+", 1) then
level:SetText(level:GetText() .. "+")
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rareelite" and not string.find(level:GetText(), "R+") then
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rareelite" and not string.find(level:GetText(), "R+", 1) then
level:SetText(level:GetText() .. "R+")
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rare" and not string.find(level:GetText(), "R") then
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rare" and not string.find(level:GetText(), "R", 1) then
level:SetText(level:GetText() .. "R")
end
end
+1 -1
View File
@@ -305,7 +305,7 @@ pfUI:RegisterModule("panel", function ()
local tmpText = getglobal("repairToolTipTextLeft"..i)
if (tmpText ~= nil) and (tmpText:GetText()) then
local searchstr = string.gsub(DURABILITY_TEMPLATE, "%%[^%s]+", "(.+)")
local _, _, lval, rval = string.find(tmpText:GetText(), searchstr)
local _, _, lval, rval = string.find(tmpText:GetText(), searchstr, 1)
if (lval and rval) then
repPercent = math.floor(lval / rval * 100)
break