diff options
author | Adam <Adam@anope.org> | 2012-11-05 22:17:47 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-06 11:02:12 -0500 |
commit | 53b2bdfe5e157a9e5ca5d08873edebcd04511ae1 (patch) | |
tree | f94c8603ffe475405ea668c629eddd7c8ba0891e /include/service.h | |
parent | 27ab6a686cb271ea8eae7a243906af5bebeb83d7 (diff) |
Use std::tr1::unordered_map for a few of the larger maps
Diffstat (limited to 'include/service.h')
-rw-r--r-- | include/service.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/service.h b/include/service.h index 98e2d82aa..95c650076 100644 --- a/include/service.h +++ b/include/service.h @@ -17,14 +17,14 @@ class CoreExport Service : public virtual Base { - static Anope::map<Anope::map<Service *> > services; + static std::map<Anope::string, std::map<Anope::string, Service *> > services; public: static Service *FindService(const Anope::string &t, const Anope::string &n) { - Anope::map<Anope::map<Service *> >::iterator it = services.find(t); + std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = services.find(t); if (it != services.end()) { - Anope::map<Service *>::iterator it2 = it->second.find(n); + std::map<Anope::string, Service *>::iterator it2 = it->second.find(n); if (it2 != it->second.end()) return it2->second; } @@ -35,9 +35,9 @@ class CoreExport Service : public virtual Base static std::vector<Anope::string> GetServiceKeys(const Anope::string &t) { std::vector<Anope::string> keys; - Anope::map<Anope::map<Service *> >::iterator it = services.find(t); + std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = services.find(t); if (it != services.end()) - for (Anope::map<Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) + for (std::map<Anope::string, Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) keys.push_back(it2->first); return keys; } @@ -58,7 +58,7 @@ class CoreExport Service : public virtual Base void Register() { - Anope::map<Service *> &smap = services[this->type]; + std::map<Anope::string, Service *> &smap = services[this->type]; if (smap.find(this->name) != smap.end()) throw ModuleException("Service " + this->type + " with name " + this->name + " already exists"); smap[this->name] = this; @@ -66,7 +66,7 @@ class CoreExport Service : public virtual Base void Unregister() { - Anope::map<Service *> &smap = services[this->type]; + std::map<Anope::string, Service *> &smap = services[this->type]; smap.erase(this->name); if (smap.empty()) services.erase(this->type); |