From a0bb43bc21eec75b4beb8ef32580f95512305fe3 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 22 Jun 2014 13:06:35 +0200 Subject: core_list Do the HasPrivPermission() check only once, not once per chan --- src/coremods/core_list.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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& 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& 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)) { -- cgit v1.2.3