Parcourir la source

[1596] Remove unneeded checks

They'd get caught by an exception anyway.
Michal 'vorner' Vaner il y a 13 ans
Parent
commit
f15c13fb80
2 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 1 2
      src/bin/auth/command.cc
  2. 1 2
      src/bin/resolver/main.cc

+ 1 - 2
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

+ 1 - 2
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());