summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-17 02:18:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-17 02:18:03 +0000
commit0632c7946c9835f24049b8cf9130409206796b33 (patch)
tree8d71ec6ba2d36ae5d92bd38efdbbe30b4535c980 /src/command_parse.cpp
parenta5af52146d191612484cdf010a2bda0dfb385ab5 (diff)
When receiving an FJOIN, if we have no local users, dont send deops, this just contributes to pointless server noise
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6028 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 2dd9a16cc..e56005751 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -1,4 +1,4 @@
-/* +------------------------------------+
+ /* +------------------------------------+
* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
@@ -452,25 +452,21 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
bool CommandParser::RemoveCommands(const char* source)
{
- bool go_again = true;
+ nspace::hash_map<std::string,command_t*>::iterator i, safeiter, last_iter;
+ last_iter = cmdlist.begin();
- while (go_again)
+ for (i = cmdlist.begin(); i != cmdlist.end(); i++)
{
- go_again = false;
-
- for (nspace::hash_map<std::string,command_t*>::iterator i = cmdlist.begin(); i != cmdlist.end(); i++)
+ if (i->second->source == std::string(source))
{
- command_t* x = i->second;
- if (x->source == std::string(source))
- {
- ServerInstance->Log(DEBUG,"removecommands(%s) Removing dependent command: %s",x->source.c_str(),x->command.c_str());
- cmdlist.erase(i);
- go_again = true;
- break;
- }
+ ServerInstance->Log(DEBUG, "removecommands(%s) Removing dependent command: %s", i->second->source.c_str(), i->second->command.c_str());
+ safeiter = i;
+ i = last_iter;
+ cmdlist.erase(safeiter);
+ continue;
}
+ last_iter = i;
}
-
return true;
}