summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-22 13:06:35 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-22 13:06:35 +0200
commita0bb43bc21eec75b4beb8ef32580f95512305fe3 (patch)
tree0bdabee9551aaf4da7d2b35b3f3e54e4fca020dc /src
parent02032ae28204264e6b7e161bac9cfd3042bab307 (diff)
core_list Do the HasPrivPermission() check only once, not once per chan
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_list.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp
index 505b0764c..128dd22ff 100644
--- a/src/coremods/core_list.cpp
+++ b/src/coremods/core_list.cpp
@@ -68,6 +68,8 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User
}
}
+ const bool has_privs = user->HasPrivPermission("channels/auspex");
+
const chan_hash& chans = ServerInstance->GetChans();
for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
@@ -87,7 +89,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User
}
// if the channel is not private/secret, OR the user is on the channel anyway
- bool n = (i->second->HasUser(user) || user->HasPrivPermission("channels/auspex"));
+ bool n = (has_privs || i->second->HasUser(user));
if (!n && i->second->IsModeSet(privatemode))
{