From d349f981fbe70fb11e3db4c486f59749ffe74c2b Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Fri, 16 Aug 2013 12:20:06 +0200 Subject: Remove ModuleManager::GetAllModuleNames(), use GetModules() instead --- src/modules/m_httpd_stats.cpp | 9 ++++----- src/modules/m_spanningtree/capab.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 022d91f1e..5114b26d5 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -141,13 +141,12 @@ class ModuleHttpStats : public Module } data << ""; - std::vector module_names = ServerInstance->Modules->GetAllModuleNames(0); + const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules(); - for (std::vector::iterator i = module_names.begin(); i != module_names.end(); ++i) + for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i) { - Module* m = ServerInstance->Modules->Find(i->c_str()); - Version v = m->GetVersion(); - data << "" << *i << "" << Sanitize(v.description) << ""; + Version v = i->second->GetVersion(); + data << "" << i->first << "" << Sanitize(v.description) << ""; } data << ""; diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index 1ca5b982c..f4f1e1ace 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -28,17 +28,18 @@ std::string TreeSocket::MyModules(int filter) { - std::vector modlist = ServerInstance->Modules->GetAllModuleNames(filter); + const ModuleManager::ModuleMap& modlist = ServerInstance->Modules->GetModules(); std::string capabilities; - sort(modlist.begin(),modlist.end()); - for (std::vector::const_iterator i = modlist.begin(); i != modlist.end(); ++i) + for (ModuleManager::ModuleMap::const_iterator i = modlist.begin(); i != modlist.end(); ++i) { + Version v = i->second->GetVersion(); + if (!(v.Flags & filter)) + continue; + if (i != modlist.begin()) capabilities.push_back(' '); - capabilities.append(*i); - Module* m = ServerInstance->Modules->Find(*i); - Version v = m->GetVersion(); + capabilities.append(i->first); if (!v.link_data.empty()) { capabilities.push_back('='); -- cgit v1.2.3