summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_callerid.cpp11
-rw-r--r--src/modules/m_dccallow.cpp6
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp8
3 files changed, 4 insertions, 21 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index f15760dca..7f615494b 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -136,10 +136,7 @@ struct CallerIDExtInfo : public ExtensionItem
continue; // shouldn't happen, but oh well.
}
- std::list<callerid_data*>::iterator it2 = std::find(targ->wholistsme.begin(), targ->wholistsme.end(), dat);
- if (it2 != targ->wholistsme.end())
- targ->wholistsme.erase(it2);
- else
+ if (!stdalgo::erase(targ->wholistsme, dat))
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (2)");
}
delete dat;
@@ -323,11 +320,7 @@ public:
return false;
}
- std::list<callerid_data*>::iterator it = std::find(dat2->wholistsme.begin(), dat2->wholistsme.end(), dat);
- if (it != dat2->wholistsme.end())
- // Found me!
- dat2->wholistsme.erase(it);
- else
+ if (!stdalgo::erase(dat2->wholistsme, dat))
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "ERROR: Inconsistency detected in callerid state, please report (4)");
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index cc7fbd323..1b838be5c 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -268,11 +268,7 @@ class ModuleDCCAllow : public Module
// remove their DCCALLOW list if they have one
if (udl)
- {
- userlist::iterator it = std::find(ul.begin(), ul.end(), user);
- if (it != ul.end())
- ul.erase(it);
- }
+ stdalgo::erase(ul, user);
// remove them from any DCCALLOW lists
// they are currently on
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 009478635..98d7c8754 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -322,13 +322,7 @@ void TreeServer::AddChild(TreeServer* Child)
bool TreeServer::DelChild(TreeServer* Child)
{
- std::vector<TreeServer*>::iterator it = std::find(Children.begin(), Children.end(), Child);
- if (it != Children.end())
- {
- Children.erase(it);
- return true;
- }
- return false;
+ return stdalgo::erase(Children, Child);
}
CullResult TreeServer::cull()