From 0d76685a4051e38ffb6b8f633dcd5d05028b1bd4 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Mon, 18 Nov 2013 02:45:12 +0400 Subject: [PATCH] Making some stuff local. Should decrese the number of clls to global functions. In theory that will give us a slight perfomance increase. --- ElvUI_SLE/ElvUI_SLE.lua | 14 +++++++++----- ElvUI_SLE/dev/elvprot.lua | 1 + ElvUI_SLE/layout/layout.lua | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ElvUI_SLE/ElvUI_SLE.lua b/ElvUI_SLE/ElvUI_SLE.lua index 1a88e97..59edbda 100755 --- a/ElvUI_SLE/ElvUI_SLE.lua +++ b/ElvUI_SLE/ElvUI_SLE.lua @@ -5,21 +5,25 @@ local DTP local EP = LibStub("LibElvUIPlugin-1.0") local addon = ... +--localizing functions-- +local IsInInstance = IsInInstance +local tinsert = tinsert + SLE.version = GetAddOnMetadata("ElvUI_SLE", "Version") E.SLEConfigs = {} function SLE:Tutorials() --Additional tutorials - table.insert(E.TutorialList, #(E.TutorialList)+1, L["To enable full values of health/power on unitframes in Shadow & Light add \":sl\" to the end of the health/power tag.\nExample: [health:current:sl]."]); + tinsert(E.TutorialList, #(E.TutorialList)+1, L["To enable full values of health/power on unitframes in Shadow & Light add \":sl\" to the end of the health/power tag.\nExample: [health:current:sl]."]); end function SLE:ConfigCats() --Additional mover groups - table.insert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L"); + tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L"); E.ConfigModeLocalizedStrings["S&L"] = L["S&L: All"] - table.insert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L DT"); + tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L DT"); E.ConfigModeLocalizedStrings["S&L DT"] = L["S&L: Datatexts"] - table.insert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L BG"); + tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L BG"); E.ConfigModeLocalizedStrings["S&L BG"] = L["S&L: Backgrounds"] - table.insert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L MISC"); + tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L MISC"); E.ConfigModeLocalizedStrings["S&L MISC"] = L["S&L: Misc"] end diff --git a/ElvUI_SLE/dev/elvprot.lua b/ElvUI_SLE/dev/elvprot.lua index e28ced2..d86bb2c 100755 --- a/ElvUI_SLE/dev/elvprot.lua +++ b/ElvUI_SLE/dev/elvprot.lua @@ -1,6 +1,7 @@ local E, L, V, P, G, _ = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local SLE = E:GetModule('SLE'); local find = string.find +local tinsert = tinsert function E:IsFoolsDay() if not SLE:Auth() then E.global.aprilFools = true end diff --git a/ElvUI_SLE/layout/layout.lua b/ElvUI_SLE/layout/layout.lua index f6ff0b3..9c52f14 100755 --- a/ElvUI_SLE/layout/layout.lua +++ b/ElvUI_SLE/layout/layout.lua @@ -2,6 +2,8 @@ local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, ProfileDB, Glob local LO = E:GetModule('Layout'); local DTP = E:GetModule('DTPanels'); +local Point = Point + local PANEL_HEIGHT = 22; local SIDE_BUTTON_WIDTH = 16; -- 1.7.9.5