Fix: optimize execution performance and memory usage via caching and table reuse

This commit is contained in:
Bluewhale1337
2026-09-16 10:24:33 +02:00
parent 7f4d4be827
commit 55bc6f1ea0
5 changed files with 45 additions and 19 deletions
+6 -1
View File
@@ -41,6 +41,7 @@ function HealBot_CheckShamanWeaponBuff(spellName)
if not firstWord then return false end
HealBot_ScanTooltip:SetOwner(UIParent, "ANCHOR_NONE")
if not HealBot_ScanTooltip_Lines then HealBot_ScanTooltip_Lines = {} end
local slots = HealBot_GetTable()
if hasMainHandEnchant then table.insert(slots, 16) end
if hasOffHandEnchant then table.insert(slots, 17) end
@@ -49,7 +50,11 @@ function HealBot_CheckShamanWeaponBuff(spellName)
HealBot_ScanTooltip:ClearLines()
HealBot_ScanTooltip:SetInventoryItem("player", slot)
for i = 1, HealBot_ScanTooltip:NumLines() do
local textObj = getglobal("HealBot_ScanTooltipTextLeft" .. i)
local textObj = HealBot_ScanTooltip_Lines[i]
if not textObj then
textObj = getglobal("HealBot_ScanTooltipTextLeft" .. i)
HealBot_ScanTooltip_Lines[i] = textObj
end
if textObj then
local text = textObj:GetText()
if text and string.find(text, firstWord) then