Quantcast WoWInterface - View Single Post - Calling a local function from another local funtion
View Single Post
12-17-12, 04:04 PM   #4
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,603
This literally does nothing:

for name in pairs(RemGankDB) do
    RemGankDB[name] = RemGankDB[name]
It just spends CPU cycles going through the database and saying "set this key to the same value it alread has". At the end of the loop absolutely nothing has actually been done.

If your database only contains name=data pairs, and not any other settings, then this is all the initialization you need to make sure it is defined as a table the first time your addon runs:

RemGankDB = RemGankDB or {}
Then, when adding a name, you will need to keep this check:

RemGankDB[name] = RemGankDB[name] or {}
It would not make sense to do anything with names at load because you do not know, in advance, the names of players who are going to kill you.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote