From 0632c7946c9835f24049b8cf9130409206796b33 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Dec 2006 02:18:03 +0000 Subject: 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 --- src/command_parse.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/command_parse.cpp') 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::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::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; } -- cgit v1.3.1-10-gc9f91