summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 0a5a8a702..4c0af3bac 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -165,12 +165,7 @@ ServiceProvider::ServiceProvider(Module* Creator, const std::string& Name, Servi
void ServiceProvider::DisableAutoRegister()
{
if ((ServerInstance) && (ServerInstance->Modules->NewServices))
- {
- ModuleManager::ServiceList& list = *ServerInstance->Modules->NewServices;
- ModuleManager::ServiceList::iterator it = std::find(list.begin(), list.end(), this);
- if (it != list.end())
- list.erase(it);
- }
+ stdalgo::erase(*ServerInstance->Modules->NewServices, this);
}
ModuleManager::ModuleManager()
@@ -192,13 +187,7 @@ bool ModuleManager::Attach(Implementation i, Module* mod)
bool ModuleManager::Detach(Implementation i, Module* mod)
{
- EventHandlerIter x = std::find(EventHandlers[i].begin(), EventHandlers[i].end(), mod);
-
- if (x == EventHandlers[i].end())
- return false;
-
- EventHandlers[i].erase(x);
- return true;
+ return stdalgo::erase(EventHandlers[i], mod);
}
void ModuleManager::Attach(Implementation* i, Module* mod, size_t sz)