summaryrefslogtreecommitdiff
path: root/src/core/cs_set.cpp
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-06-21 23:14:28 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-06-21 23:14:28 -0400
commit1e20877e2f529b61b205a0b1202c32962ee47938 (patch)
tree85e4655edf6071d41391362b5d9fcdd0589d63c8 /src/core/cs_set.cpp
parentfb16ce72a0b5a3ce336e003327c8d1740f4fdb98 (diff)
The next of a few "CBX OCDing over code style" commits, focusing on src/core/bs_* and src/core/cs_*.
Diffstat (limited to 'src/core/cs_set.cpp')
-rw-r--r--src/core/cs_set.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/cs_set.cpp b/src/core/cs_set.cpp
index c11a1c102..5f7d2da83 100644
--- a/src/core/cs_set.cpp
+++ b/src/core/cs_set.cpp
@@ -7,9 +7,8 @@
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
- *
- *
*/
+
/*************************************************************************/
#include "module.h"
@@ -25,10 +24,8 @@ class CommandCSSet : public Command
~CommandCSSet()
{
- for (std::map<ci::string, Command *>::const_iterator it = this->subcommands.begin(); it != this->subcommands.end(); ++it)
- {
+ for (std::map<ci::string, Command *>::const_iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
delete it->second;
- }
this->subcommands.clear();
}
@@ -45,13 +42,12 @@ class CommandCSSet : public Command
return MOD_CONT;
}
-
Command *c = this->FindCommand(params[1]);
if (c)
{
ci::string cmdparams = cs_findchan(params[0])->name.c_str();
- for (std::vector<ci::string>::const_iterator it = params.begin() + 2; it != params.end(); ++it)
+ for (std::vector<ci::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
cmdparams += " " + *it;
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
}
@@ -69,7 +65,7 @@ class CommandCSSet : public Command
if (subcommand.empty())
{
notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_HEAD);
- for (std::map<ci::string, Command *>::iterator it = this->subcommands.begin(); it != this->subcommands.end(); ++it)
+ for (std::map<ci::string, Command *>::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
it->second->OnServHelp(u);
notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_TAIL);
return true;
@@ -79,9 +75,7 @@ class CommandCSSet : public Command
Command *c = this->FindCommand(subcommand);
if (c)
- {
return c->OnHelp(u, subcommand);
- }
}
return false;
@@ -112,9 +106,7 @@ class CommandCSSet : public Command
std::map<ci::string, Command *>::const_iterator it = this->subcommands.find(subcommand);
if (it != this->subcommands.end())
- {
return it->second;
- }
return NULL;
}