From 373b0027eae733ef39e3fbb59a45e03e7907056b Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 22 Jun 2014 13:10:03 +0200 Subject: core_list Check whether the chan name/topic has to be Match()ed once, not once per chan --- src/coremods/core_list.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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& 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& 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; -- cgit v1.2.3