View Single Post
12-28-14, 04:37 PM   #3
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Duugu View Post
My guess: as you're unregistering ADDON_LOADED without checking the addons name both Versions will only work if there are no other addons enabled or if there are no other addons loaded before your addon.
Nah, unregistering ADDON_LOADED after your addon have been found and loaded, will save some resources. Because if you don't unregister it even after your addon is loaded it will run over the other addons which comes after yours alphabetically, and gonna try to compare their name to your addon, aka run the for cycle which loops over addons further. Unregistering is pretty much breaking from that cycle, after you found what you looking for.

It's pointless tho if your addon's name is at the end of the alphabet.

I personally like the second one, since it's gonna help you to keep organized with more complex projects, specially if you want to call functions from different files. But for such a small ones it's pretty much up to you which one you prefer, since the resourse usage difference is negligible even if you duplicate thoose functions.

Last edited by Resike : 12-28-14 at 04:45 PM.
  Reply With Quote