From 772dad05a42e20e03a5445b84a7f6612ee44283f Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 28 Nov 2012 03:22:02 +0100 Subject: m_spanningtree Remove redundant params.size() checks TreeSocket::ProcessConnectedLine() and CommandParser::CallHandler() only call the handler when there are enough parameters --- src/modules/m_spanningtree/fjoin.cpp | 2 -- src/modules/m_spanningtree/uid.cpp | 9 --------- 2 files changed, 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 929ace474..71d837b28 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -55,8 +55,6 @@ CmdResult CommandFJoin::Handle(const std::vector& params, User *src * losing side, so only its own modes get applied. Life is simple for those * who succeed at internets. :-) */ - if (params.size() < 3) - return CMD_INVALID; irc::modestacker modestack(true); /* Modes to apply from the users in the user list */ User* who = NULL; /* User we are currently checking */ diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 4a73eb80c..f33cb038d 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -35,9 +35,6 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) * 0 1 2 3 4 5 6 7 8 9 (n-1) * UID uuid age nick host dhost ident ip.string signon +modes (modepara) :gecos */ - if (params.size() < 10) - return CMD_INVALID; - time_t age_t = ConvToInt(params[1]); time_t signon = ConvToInt(params[7]); std::string empty; @@ -163,8 +160,6 @@ CmdResult CommandUID::Handle(const parameterlist ¶ms, User* serversrc) CmdResult CommandFHost::Handle(const parameterlist ¶ms, User* src) { - if (params.size() < 1) - return CMD_INVALID; if (IS_SERVER(src)) return CMD_FAILURE; src->ChangeDisplayedHost(params[0].c_str()); @@ -173,8 +168,6 @@ CmdResult CommandFHost::Handle(const parameterlist ¶ms, User* src) CmdResult CommandFIdent::Handle(const parameterlist ¶ms, User* src) { - if (params.size() < 1) - return CMD_INVALID; if (IS_SERVER(src)) return CMD_FAILURE; src->ChangeIdent(params[0].c_str()); @@ -183,8 +176,6 @@ CmdResult CommandFIdent::Handle(const parameterlist ¶ms, User* src) CmdResult CommandFName::Handle(const parameterlist ¶ms, User* src) { - if (params.size() < 1) - return CMD_INVALID; if (IS_SERVER(src)) return CMD_FAILURE; src->ChangeName(params[0].c_str()); -- cgit v1.2.3