View Single Post
01-23-14, 05:52 PM   #7
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by Aanson View Post
<snip>

Anyone know the better of these two? getn(self.Events) vs #self.Events? I expect it's probably negligible to the point of being irrelevant.
<snip>
The table.getn method was actually deprecated in Lua 5.1 in favor of the unary length operator (#). You should also be using pairs for dictionary-style tables. For array-style tables, you can use either ipairs or the (slightly faster) incremental loop.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote