diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-22 13:06:35 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-22 13:06:35 +0200 |
commit | a0bb43bc21eec75b4beb8ef32580f95512305fe3 (patch) | |
tree | 0bdabee9551aaf4da7d2b35b3f3e54e4fca020dc | |
parent | 02032ae28204264e6b7e161bac9cfd3042bab307 (diff) |
core_list Do the HasPrivPermission() check only once, not once per chan
-rw-r--r-- | src/coremods/core_list.cpp | 4 |
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)) { |