Thread: Slash commands
View Single Post
04-03-09, 02:32 PM   #7
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by p3lim View Post
Code:
for k, v in next, defaults do
this checks the entries
Code:
if(type(pMinimapDB[k]) == 'nil') then
this checks if the value has been reset and/or does not exist.

if so, proceed to add the default settings.
I know exactly what the code does, I was just interested why you were so keen to avoid a pairs() call and yet will call type() and do a table lookup on each iteration when you could just do
Code:
if pMinimapDB[k] == nil then
.

But I digress.

Last edited by Slakah : 04-03-09 at 02:55 PM.
  Reply With Quote