mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-07-28 10:14:44 +00:00
perf: replace table.foreach with pairs loops to avoid GC spikes during combat
This commit is contained in:
+4
-4
@@ -22,9 +22,9 @@ function HealBot_ShouldHeal(unit)
|
||||
end
|
||||
|
||||
function HealBot_Action_ShouldHealSome()
|
||||
return table.foreach(HealBot_Action_HealButtons, function (index,button)
|
||||
for index, button in pairs(HealBot_Action_HealButtons) do
|
||||
if (HealBot_ShouldHeal(button.unit)) then return button.unit; end
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
function HealBot_MustHeal(unit)
|
||||
@@ -32,9 +32,9 @@ function HealBot_MustHeal(unit)
|
||||
end
|
||||
|
||||
function HealBot_Action_MustHealSome()
|
||||
return table.foreach(HealBot_Action_HealButtons, function (index,button)
|
||||
for index, button in pairs(HealBot_Action_HealButtons) do
|
||||
if (HealBot_MustHeal(button.unit)) then return button.unit; end
|
||||
end);
|
||||
end
|
||||
end
|
||||
|
||||
function HealBot_GetRezSpellForClass()
|
||||
|
||||
Reference in New Issue
Block a user