summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-07 23:46:44 -0500
committerAdam <Adam@anope.org>2013-04-07 23:46:44 -0500
commitfb7fef7a849342ab8463743497e781c5c3e6ae88 (patch)
tree5d230a68b6eed70c7b4f718410dd62fea779654c /modules/commands/cs_mode.cpp
parent36602224b8b1a11326a224779d16bcb12f0ed532 (diff)
Optimizations of much of the more commonly used code
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r--modules/commands/cs_mode.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index 7edc4eddc..1d0f0985b 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -253,9 +253,11 @@ class CommandCSMode : public Command
case '*':
if (adding == -1 || !has_access)
break;
- for (unsigned j = 0; j < ModeManager::ChannelModes.size(); ++j)
+ for (unsigned j = 0; j < ModeManager::GetChannelModes().size(); ++j)
{
- ChannelMode *cm = ModeManager::ChannelModes[j];
+ ChannelMode *cm = ModeManager::GetChannelModes()[j];
+ if (!cm)
+ continue;
if (!u || cm->CanSet(u))
{
if (cm->type == MODE_REGULAR || (!adding && cm->type == MODE_PARAM))
@@ -309,9 +311,10 @@ class CommandCSMode : public Command
break;
}
- for (Channel::ChanUserList::const_iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it)
+ for (Channel::ChanUserList::const_iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end;)
{
- ChanUserContainer *uc = *it;
+ ChanUserContainer *uc = it->second;
+ ++it;
AccessGroup targ_access = ci->AccessFor(uc->user);