Quantcast

* Slight optimisation to the buff display, using setformattedtext

James Whitehead II [01-25-08 - 18:44]
* Slight optimisation to the buff display, using setformattedtext
Filename
PerfectRaid_Buffs.lua
diff --git a/PerfectRaid_Buffs.lua b/PerfectRaid_Buffs.lua
index 3468e3e..9e14a97 100644
--- a/PerfectRaid_Buffs.lua
+++ b/PerfectRaid_Buffs.lua
@@ -121,6 +121,12 @@ local BIT_DISEASE = 8
 local debuffstatus = setmetatable({}, {__index=function(t,k) rawset(t,k,0); return 0 end})

 local work = {}
+local patterns = setmetatable({}, {__index=function(t,k)
+											   local str = string.rep("%s ", k):sub(1,-2)
+											   rawset(t,k,str)
+											   return str
+										   end})
+
 function Buffs:UNIT_AURA(event, unit)
 	if not frames[unit] then return end

@@ -247,9 +253,8 @@ function Buffs:UNIT_AURA(event, unit)
 		end
 	end

-	local status = strjoin(" ", unpack(work))
 	for frame in pairs(frames[unit]) do
-		frame.aura:SetFormattedText(status)
+		frame.aura:SetFormattedText(patterns[#work], unpack(work))
 	end
 end