summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-08-07 21:14:05 +0000
committerAdam <Adam@anope.org>2013-08-07 21:19:49 +0000
commitb93d650b1f63a0159a88404bd64f79311700b11d (patch)
tree5d0cfc9512f4f8dad08646694ab3fd7e6d440f1b /include/modules.h
parentc48069536922db4a227545fd915c37af141071e9 (diff)
Revert "Shrink to fit module event vectors when modules are removed from them"
Sometimes the events call the function the event is in, which causes a resize while the original function is iterating. This reverts commit 7f1b5552dc4ddccb688120d66946601fa695b650.
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/include/modules.h b/include/modules.h
index aef6d7d30..14661d1c7 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -63,7 +63,6 @@
if (true) \
{ \
static std::vector<Module *> &_modules = ModuleManager::GetEventHandlers(#ename); \
- bool _shrink = false; \
for (std::vector<Module *>::iterator _i = _modules.begin(); _i != _modules.end();) \
{ \
try \
@@ -77,13 +76,10 @@ if (true) \
catch (const NotImplementedException &) \
{ \
_i = _modules.erase(_i); \
- _shrink = true; \
continue; \
} \
++_i; \
} \
- if (_shrink) \
- std::vector<Module *>(_modules).swap(_modules); \
} \
else \
static_cast<void>(0)
@@ -101,7 +97,6 @@ if (true) \
{ \
ret = EVENT_CONTINUE; \
static std::vector<Module *> &_modules = ModuleManager::GetEventHandlers(#ename); \
- bool _shrink = false; \
for (std::vector<Module *>::iterator _i = _modules.begin(); _i != _modules.end();) \
{ \
try \
@@ -120,13 +115,10 @@ if (true) \
catch (const NotImplementedException &) \
{ \
_i = _modules.erase(_i); \
- _shrink = true; \
continue; \
} \
++_i; \
} \
- if (_shrink) \
- std::vector<Module *>(_modules).swap(_modules); \
} \
else \
static_cast<void>(0)