From 0c476dd0ca2dc9fc811d760306a541caddf30edb Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 9 Apr 2014 15:02:10 +0200 Subject: Avoid double Membership lookup in Channel::UserList() The user is always inside if UserList() is called from ForceJoin() and the HasUser() result obtained in the /NAMES handler can be reused --- src/channels.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 485ffd4c9..089b6927e 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -626,7 +626,7 @@ const char* Channel::ChanModes(bool showkey) /* compile a userlist of a channel into a string, each nick seperated by * spaces and op, voice etc status shown as @ and +, and send it to 'user' */ -void Channel::UserList(User *user) +void Channel::UserList(User* user, bool has_user) { bool has_privs = user->HasPrivPermission("channels/auspex"); std::string list; @@ -635,11 +635,6 @@ void Channel::UserList(User *user) list.append(this->name).append(" :"); std::string::size_type pos = list.size(); - /* Improvement by Brain - this doesnt change in value, so why was it inside - * the loop? - */ - bool has_user = this->HasUser(user); - const size_t maxlen = ServerInstance->Config->Limits.MaxLine - 10 - ServerInstance->Config->ServerName.size(); std::string prefixlist; std::string nick; -- cgit v1.3.1-10-gc9f91