diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-04-09 15:02:10 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-04-09 15:02:10 +0200 |
commit | 0c476dd0ca2dc9fc811d760306a541caddf30edb (patch) | |
tree | 33ae6f6fc61afbb5406a36fd1256c812ec79f604 /src/channels.cpp | |
parent | 6dc4436ae48e6cc4b309d3cec609047920916cde (diff) |
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
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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; |