diff options
Diffstat (limited to 'src/core/cs_set.cpp')
-rw-r--r-- | src/core/cs_set.cpp | 16 |
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; } |