From a4f5816610a30bdfb4be425c79f404378566a425 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Fri, 29 Mar 2013 01:57:26 +0000 Subject: [PATCH] Use SetFormattedText instead of SetText method for memory efficiency. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@854 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleIcone.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/OvaleIcone.lua b/OvaleIcone.lua index a990b52..cef6daa 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -18,7 +18,6 @@ local OvaleOptions = Ovale.OvaleOptions local OvaleState = Ovale.OvaleState local strfind = string.find -local strformat = string.format local strsub = string.sub -- @@ -33,15 +32,14 @@ local function SetValue(self, value, actionTexture) self.shortcut:Hide() if value then if value<10 then - value = strformat("%.1f", value) + self.remains:SetFormattedText("%.1f", value) else - value = strformat("%d", value) + self.remains:SetFormattedText("%d", value) end - self.remains:SetText(value) + self.remains:Show() else - self.remains:SetText() + self.remains:Hide() end - self.remains:Show() self:Show() end @@ -134,7 +132,7 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a -- Le temps restant if ((profile.apparence.numeric or self.params.text == "always") and minAttente > OvaleState.maintenant) then - self.remains:SetText(strformat("%.1f", minAttente - OvaleState.maintenant)) + self.remains:SetFormattedText("%.1f", minAttente - OvaleState.maintenant) self.remains:Show() else self.remains:Hide() @@ -146,7 +144,6 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a self.shortcut:SetText(actionShortcut) else self.shortcut:Hide() - self.shortcut:SetText("") end -- L'indicateur de portée -- 1.7.9.5