Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-10-14, 11:54 PM   #31
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Add:
Code:
local _, cfg = ... --import config
local addon, ns = ... --get addon namespace
local hasBeautycase = IsAddOnLoaded("!Beautycase")
local _, playerClass = UnitClass("player")
Then change all other instances of:
Code:
        if IsAddOnLoaded("!Beautycase") then
...to:
Code:
        if hasBeautycase then
It won't make a huge difference, it's just a matter of logical principle -- for example, what you're doing now is the same as if instead of creating that "playerClass" variable at the top of your file, you looked up the player's class again every time you wanted to class-color something. If the return value from a function will never change, there's no reason to keep calling it over and over.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Trying my hand at ouf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off