diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-22 13:10:03 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-22 13:10:03 +0200 |
commit | 373b0027eae733ef39e3fbb59a45e03e7907056b (patch) | |
tree | 3b6edda8065fc28fcd69061c450635f5774c070d /src | |
parent | a0bb43bc21eec75b4beb8ef32580f95512305fe3 (diff) |
core_list Check whether the chan name/topic has to be Match()ed once, not once per chan
Diffstat (limited to 'src')
-rw-r--r-- | src/coremods/core_list.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 128dd22ff..bf9d9bdae 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -69,6 +69,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User } const bool has_privs = user->HasPrivPermission("channels/auspex"); + const bool match_name_topic = ((!parameters.empty()) && (!parameters[0].empty()) && (parameters[0][0] != '<') && (parameters[0][0] != '>')); const chan_hash& chans = ServerInstance->GetChans(); for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i) @@ -82,7 +83,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User if (too_many || too_few) continue; - if (parameters.size() && !parameters[0].empty() && (parameters[0][0] != '<' && parameters[0][0] != '>')) + if (match_name_topic) { if (!InspIRCd::Match(i->second->name, parameters[0]) && !InspIRCd::Match(i->second->topic, parameters[0])) continue; |