Originally Posted by Barjack
... if that lookup has the potential to happen 10 times per function in a function that might happen 20 times per second during combat, then I personally would definitely consider making it local.
|
If you are looking up the same table value 200 times per second, or even calling the same function 20 times per second, in combat or nto, you are doing something horribly wrong.
Originally Posted by Aanson
local cW = f.chatWindow
|
I'd really suggest avoiding cryptic variable names like
cW outside of macros. Space is unlimited in addon code. Use names that (a) will immediately make sense to you if you don't look at the code for 6 months, and (b) will immediately make sense to other pgorammers looking at your code for the first time. There's just no reason to use something like
cW -- where you have to try to figure it out from context, eg. seeing
cW:AddMessage(...), or go find where it's defined -- instead of a descriptive name like
chatWindow.