]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Instead of a vector of vectors, use an array of vectors as in the original spec on...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 4 Nov 2007 21:57:27 +0000 (21:57 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 4 Nov 2007 21:57:27 +0000 (21:57 +0000)
This is faster, as only the inner list resizes, and this avoids calls to std::vector::operator[]

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8531 e03df62e-2008-0410-955e-edbf42e46eb7

include/modules.h
src/modules.cpp

index 6a56384f5ec05ad306b486768b5eec8b5f1fc136..ef0d3f6200de3d394f5da3f27495cdf9c402ae31 100644 (file)
@@ -1521,10 +1521,6 @@ typedef DLLFactory<Module> ircd_module;
  */
 typedef std::vector<Module*> IntModuleList;
 
-/** A list of event handlers
- */
-typedef std::vector<IntModuleList> EventHandlerList;
-
 /** An event handler iterator
  */
 typedef IntModuleList::iterator EventHandlerIter;
@@ -1576,7 +1572,7 @@ class CoreExport ModuleManager : public classbase
        /** Event handler hooks.
         * This needs to be public to be used by FOREACH_MOD and friends.
         */
-       EventHandlerList EventHandlers;
+       IntModuleList EventHandlers[I_END];
 
        /** Simple, bog-standard, boring constructor.
         */
index 7eb97873fad9dc0fb88635fe79f7a5e75b58459d..ef494a7c6f5fcf605091d51d7cad87d3372ce586 100644 (file)
@@ -191,8 +191,6 @@ void                Module::OnText(User*, void*, int, const std::string&, char, CUList&) { }
 
 ModuleManager::ModuleManager(InspIRCd* Ins) : ModCount(0), Instance(Ins)
 {
-       for (int n = I_BEGIN; n != I_END; ++n)
-               EventHandlers.push_back(std::vector<Module*>());
 }
 
 ModuleManager::~ModuleManager()