From d8f98565a8617658f610bc94a5d87266930beee4 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:46:13 +0000 Subject: Use ConfigTagList as a faster access method for access to configuration git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11948 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/utils.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index b8560aaba..10a888833 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -368,11 +368,10 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) if (rebind) { - for (int j = 0; ; j++) + ConfigTagList tags = ServerInstance->Config->ConfTags("bind"); + for(ConfigIter i = tags.first; i != tags.second; ++i) { - ConfigTag* tag = ServerInstance->Config->ConfValue("bind", j); - if (!tag) - break; + ConfigTag* tag = i->second; std::string Type = tag->getString("type"); std::string IP = tag->getString("address"); std::string Port = tag->getString("port"); @@ -417,11 +416,10 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) AutoconnectBlocks.clear(); LinkBlocks.clear(); ValidIPs.clear(); - for (int j = 0;; ++j) + ConfigTagList tags = ServerInstance->Config->ConfTags("link"); + for(ConfigIter i = tags.first; i != tags.second; ++i) { - ConfigTag* tag = ServerInstance->Config->ConfValue("link", j); - if (!tag) - break; + ConfigTag* tag = i->second; reference L = new Link(tag); L->Name = tag->getString("name").c_str(); L->AllowMask = tag->getString("allowmask"); @@ -479,11 +477,10 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind) LinkBlocks.push_back(L); } - for (int j = 0;; ++j) + tags = ServerInstance->Config->ConfTags("autoconnect"); + for(ConfigIter i = tags.first; i != tags.second; ++i) { - ConfigTag* tag = ServerInstance->Config->ConfValue("autoconnect", j); - if (!tag) - break; + ConfigTag* tag = i->second; reference A = new Autoconnect(tag); A->Period = tag->getInt("period"); A->NextConnectTime = ServerInstance->Time() + A->Period; -- cgit v1.2.3