diff options
Diffstat (limited to 'src/opertype.cpp')
-rw-r--r-- | src/opertype.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/opertype.cpp b/src/opertype.cpp index 0ee6d000f..968163003 100644 --- a/src/opertype.cpp +++ b/src/opertype.cpp @@ -3,9 +3,6 @@ * Copyright (C) 2008-2010 Anope Team <team@anope.org> * * Please read COPYING and README for further details. - * - * - * */ #include "services.h" @@ -14,56 +11,48 @@ OperType::OperType(const ci::string &nname) : name(nname) { } -bool OperType::HasCommand(const std::string &cmdstr) const +bool OperType::HasCommand(const ci::string &cmdstr) const { - for (std::list<std::string>::const_iterator it = this->commands.begin(); it != this->commands.end(); ++it) + for (std::list<ci::string>::const_iterator it = this->commands.begin(), it_end = this->commands.end(); it != it_end; ++it) { if (Anope::Match(cmdstr, *it)) - { return true; - } } - for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(); iit != this->inheritances.end(); ++iit) + for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit) { OperType *ot = *iit; if (ot->HasCommand(cmdstr)) - { return true; - } } return false; } -bool OperType::HasPriv(const std::string &privstr) const +bool OperType::HasPriv(const ci::string &privstr) const { - for (std::list<std::string>::const_iterator it = this->privs.begin(); it != this->privs.end(); ++it) + for (std::list<ci::string>::const_iterator it = this->privs.begin(), it_end = this->privs.end(); it != it_end; ++it) { if (Anope::Match(privstr, *it)) - { return true; - } } - for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(); iit != this->inheritances.end(); ++iit) + for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit) { OperType *ot = *iit; if (ot->HasPriv(privstr)) - { return true; - } } return false; } -void OperType::AddCommand(const std::string &cmdstr) +void OperType::AddCommand(const ci::string &cmdstr) { this->commands.push_back(cmdstr); } -void OperType::AddPriv(const std::string &privstr) +void OperType::AddPriv(const ci::string &privstr) { this->privs.push_back(privstr); } @@ -77,4 +66,3 @@ void OperType::Inherits(OperType *ot) { this->inheritances.insert(ot); } - |