summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-06-22 13:22:44 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-06-22 13:22:44 +0200
commitee0c7d07afb33935e1f7f23144e2e33ced33f762 (patch)
tree6fe222867eeec2b3f860076a3952af84bcb0ad02 /src/coremods
parent8670d8c51f1debd8afb6732e782fc61d2e479349 (diff)
core_ison Use iterators
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_ison.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/coremods/core_ison.cpp b/src/coremods/core_ison.cpp
index 8c1c3d2f5..ebb43bdf9 100644
--- a/src/coremods/core_ison.cpp
+++ b/src/coremods/core_ison.cpp
@@ -65,20 +65,21 @@ bool CommandIson::AddNick(User* user, User* toadd, std::string& reply, const std
*/
CmdResult CommandIson::Handle (const std::vector<std::string>& parameters, User *user)
{
- User *u;
std::string reply = "303 " + user->nick + " :";
const std::string::size_type pos = reply.size();
- for (unsigned int i = 0; i < parameters.size(); i++)
+ for (std::vector<std::string>::const_iterator i = parameters.begin(); i != parameters.end(); ++i)
{
- u = ServerInstance->FindNickOnly(parameters[i]);
+ const std::string& targetstr = *i;
+
+ User* const u = ServerInstance->FindNickOnly(targetstr);
if (!AddNick(user, u, reply, pos))
{
- if ((i == parameters.size() - 1) && (parameters[i].find(' ') != std::string::npos))
+ if ((i == parameters.end() - 1) && (targetstr.find(' ') != std::string::npos))
{
/* Its a space seperated list of nicks (RFC1459 says to support this)
*/
- irc::spacesepstream list(parameters[i]);
+ irc::spacesepstream list(targetstr);
std::string item;
while (list.GetToken(item))