summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treeserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.cpp')
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 65e119149..493b05ebf 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -321,13 +321,11 @@ void TreeServer::AddChild(TreeServer* Child)
bool TreeServer::DelChild(TreeServer* Child)
{
- for (std::vector<TreeServer*>::iterator a = Children.begin(); a != Children.end(); a++)
+ std::vector<TreeServer*>::iterator it = std::find(Children.begin(), Children.end(), Child);
+ if (it != Children.end())
{
- if (*a == Child)
- {
- Children.erase(a);
- return true;
- }
+ Children.erase(it);
+ return true;
}
return false;
}