Thread: API Changes
View Single Post
09-07-14, 10:09 PM   #36
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by jaliborc View Post
I want to be able to check if an addon is enabled without having to mess my code with loops on all my addons, so I made a library for this: https://github.com/Jaliborc/AddonList-1.0 (yeah, feels stupid to have such a small lib, but crappy APIs lead to crappy solutions). Just in case someone is interested.
Since the list of addons cannot change during a session, you should just create a static name->index table, and use a simple table lookup to get the index for the requested name, instead of calling a function that loops over all addons and calls more functions every time.
__________________
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.