diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:46:13 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:46:13 +0000 |
commit | d8f98565a8617658f610bc94a5d87266930beee4 (patch) | |
tree | 365a153c59bc8b521b094c27f25b484a69e5154b /src/modules/m_spanningtree/utils.cpp | |
parent | 984cc96a1f832abf9b5fcfddcd8260c5b12bd2a9 (diff) |
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
Diffstat (limited to 'src/modules/m_spanningtree/utils.cpp')
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
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<Link> 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<Autoconnect> A = new Autoconnect(tag); A->Period = tag->getInt("period"); A->NextConnectTime = ServerInstance->Time() + A->Period; |