diff options
| author | Adam <Adam@anope.org> | 2013-02-13 17:42:01 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-02-14 01:20:18 -0500 |
| commit | 9e544a6443117861c3d6406e435043f1cf0f7099 (patch) | |
| tree | e7449fb01e377576e8a09f386117d2c251de0596 /modules/extra/webcpanel/pages/chanserv/info.cpp | |
| parent | 225b7c38c127fbc6aac6724012f71c9483a4da77 (diff) | |
Store what channels have references to accounts in NickCore to prevent having to iterate over all channels and then all access entries when nicks expire or from nickserv/alist
Diffstat (limited to 'modules/extra/webcpanel/pages/chanserv/info.cpp')
| -rw-r--r-- | modules/extra/webcpanel/pages/chanserv/info.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/extra/webcpanel/pages/chanserv/info.cpp b/modules/extra/webcpanel/pages/chanserv/info.cpp index 18f6b8f7a..95592706d 100644 --- a/modules/extra/webcpanel/pages/chanserv/info.cpp +++ b/modules/extra/webcpanel/pages/chanserv/info.cpp @@ -13,10 +13,11 @@ WebCPanel::ChanServ::Info::Info(const Anope::string &cat, const Anope::string &u bool WebCPanel::ChanServ::Info::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply, NickAlias *na, TemplateFileServer::Replacements &replacements) { - // XXX this is slightly inefficient - for (registered_channel_map::const_iterator it = RegisteredChannelList->begin(), it_end = RegisteredChannelList->end(); it != it_end; ++it) + std::deque<ChannelInfo *> queue; + na->nc->GetChannelReferences(queue); + for (unsigned i = 0; i < queue.size(); ++i) { - ChannelInfo *ci = it->second; + ChannelInfo *ci = queue[i]; if (ci->AccessFor(na->nc).HasPriv("SET") || ci->AccessFor(na->nc).HasPriv("ACCESS_LIST")) { |
