View Single Post
11-19-12, 04:37 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Nimhfree View Post
if nil == mounts[category] then
FYI, in Lua you do not need to explicitly check that something is equal to nil. You can just do:
if not mounts[category] then
...or you can make it more robust by checking its type instead:
if type(mounts[category]) ~= "table" then
The only reason you'd ever need to check that a value was equal to nil would be if you were using both nil and false values with different meanings, which isn't a very common scenario.
__________________
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