summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-04-09 14:50:37 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-04-09 14:50:37 +0200
commitb4a7847bb8f39b466161c5fde7e58d41e81275d7 (patch)
treebb3dbdc327b101f41fc790cb7ff0767057f25769 /src
parent44259095793bfcc9c3de4acf41820b2f8464ab7e (diff)
Eliminate usage of has_one in Channel::UserList()
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 4555deb96..5954d8ded 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -641,8 +641,6 @@ void Channel::UserList(User *user)
list.append(this->name).append(" :");
std::string::size_type pos = list.size();
- bool has_one = false;
-
/* Improvement by Brain - this doesnt change in value, so why was it inside
* the loop?
*/
@@ -683,19 +681,14 @@ void Channel::UserList(User *user)
// Erase all nicks, keep the constant part
list.erase(pos);
- has_one = false;
}
list.append(prefixlist).append(nick).push_back(' ');
-
- has_one = true;
}
- /* if whats left in the list isnt empty, send it */
- if (has_one)
- {
+ // Only send the user list numeric if there is at least one user in it
+ if (list.size() != pos)
user->WriteNumeric(RPL_NAMREPLY, list);
- }
user->WriteNumeric(RPL_ENDOFNAMES, "%s :End of /NAMES list.", this->name.c_str());
}