Przeglądaj źródła

Remove NULL check for pref because pref is always non NULL

Tatsuhiro Tsujikawa 12 lat temu
rodzic
commit
a4a4a10490
2 zmienionych plików z 0 dodań i 8 usunięć
  1. 0 4
      src/RpcMethod.cc
  2. 0 4
      src/aria2api.cc

+ 0 - 4
src/RpcMethod.cc

@@ -90,10 +90,6 @@ void gatherOption
   for(; first != last; ++first) {
     const std::string& optionName = (*first).first;
     const Pref* pref = option::k2p(optionName);
-    if(!pref) {
-      throw DL_ABORT_EX
-        (fmt("We don't know how to deal with %s option", optionName.c_str()));
-    }
     const OptionHandler* handler = optionParser->find(pref);
     if(!handler || !pred(handler)) {
       // Just ignore the unacceptable options in this context.

+ 0 - 4
src/aria2api.cc

@@ -205,10 +205,6 @@ void apiGatherOption
   for(; first != last; ++first) {
     const std::string& optionName = (*first).first;
     const Pref* pref = option::k2p(optionName);
-    if(!pref) {
-      throw DL_ABORT_EX
-        (fmt("We don't know how to deal with %s option", optionName.c_str()));
-    }
     const OptionHandler* handler = optionParser->find(pref);
     if(!handler || !pred(handler)) {
       // Just ignore the unacceptable options in this context.