From fbc73e20784b055485f676096e758d6aeed62e0c Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 1 Nov 2014 18:17:04 +0100 Subject: Add stdalgo::erase() and use it to simplify code --- src/modules/m_spanningtree/treeserver.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/modules/m_spanningtree/treeserver.cpp') 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::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() -- cgit v1.2.3