From 7264a6a8d4360989ca2f64230da07c562d0f34f1 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 19 Jul 2013 13:40:07 +0200 Subject: m_spanningtree Add TreeServer::GetChildren() that replaces ChildCount() and GetChild() --- src/modules/m_spanningtree/treeserver.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 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 54ea5922f..8af3e777d 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -119,9 +119,9 @@ void TreeServer::FinishBurstInternal() this->bursting = false; SetNextPingTime(ServerInstance->Time() + Utils->PingFreq); SetPingFlag(); - for(unsigned int q=0; q < ChildCount(); q++) + for (ChildServers::const_iterator i = Children.begin(); i != Children.end(); ++i) { - TreeServer* child = GetChild(q); + TreeServer* child = *i; child->FinishBurstInternal(); } } @@ -229,28 +229,6 @@ void TreeServer::SetVersion(const std::string &Version) VersionString = Version; } -unsigned int TreeServer::ChildCount() -{ - return Children.size(); -} - -TreeServer* TreeServer::GetChild(unsigned int n) -{ - if (n < Children.size()) - { - /* Make sure they cant request - * an out-of-range object. After - * all we know what these programmer - * types are like *grin*. - */ - return Children[n]; - } - else - { - return NULL; - } -} - void TreeServer::AddChild(TreeServer* Child) { Children.push_back(Child); -- cgit v1.2.3