View Single Post
03-14-14, 04:31 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Could still use some more variables. :P

Also, there's no value in looking things up in _G instead of just using them directly, eg. this:
Code:
_G["PlayerFrame"]:DoSomething()
...costs a global lookup and a table lookup, so it's actually slower than this:
Code:
PlayerFrame:DoSomething()
...which only costs a global lookup.

The only reason to look something up in _G is if it's dynamically constructed, eg.
Code:
for i = 1, 4 do
    _G["PartyFrame"..i]:DoSomething()
end
...where the exact object name is not "known" ahead of time.
__________________
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