From: Michal 'vorner' Vaner Date: Tue, 14 Feb 2012 08:56:55 +0000 (+0100) Subject: [1596] Remove unneeded checks X-Git-Tag: trac2351_base~97^2~32^2~3^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f15c13fb80fd6512f31df035555392494c6dfbd2;p=thirdparty%2Fkea.git [1596] Remove unneeded checks They'd get caught by an exception anyway. --- diff --git a/src/bin/auth/command.cc b/src/bin/auth/command.cc index 1b440db0f5..ad0d134f88 100644 --- a/src/bin/auth/command.cc +++ b/src/bin/auth/command.cc @@ -109,8 +109,7 @@ class ShutdownCommand : public AuthCommand { public: virtual void exec(AuthSrv& server, isc::data::ConstElementPtr args) { // Is the pid argument provided? - if (args && args->getType() == isc::data::Element::map && - args->contains("pid")) { + if (args && args->contains("pid")) { // If it is, we check it is the same as our PID // This might throw in case the type is not an int, but that's diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc index b390f3349c..1cf7f9e1c6 100644 --- a/src/bin/resolver/main.cc +++ b/src/bin/resolver/main.cc @@ -88,8 +88,7 @@ my_command_handler(const string& command, ConstElementPtr args) { answer = createAnswer(0, args); } else if (command == "shutdown") { // Is the pid argument provided? - if (args && args->getType() == isc::data::Element::map && - args->contains("pid")) { + if (args && args->contains("pid")) { // If it is, we check it is the same as our PID const int pid(args->get("pid")->intValue()); const pid_t my_pid(getpid());