[neurun] Remove switch stmt from addOperationEx (#4591)
author김수진/On-Device Lab(SR)/Engineer/삼성전자 <sjsujin.kim@samsung.com>
Wed, 6 Mar 2019 05:20:19 +0000 (14:20 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 6 Mar 2019 05:20:19 +0000 (14:20 +0900)
As applied in #4577, This commit removes switch stmt from addOperationEx too.

Signed-off-by: sjsujinkim <sjsujin.kim@samsung.com>
runtimes/neurun/src/frontend/wrapper/model.cc

index 7a916ed..d1a4155 100644 (file)
@@ -133,18 +133,8 @@ bool ANeuralNetworksModel::addOperationEx(ANeuralNetworksOperationTypeEx type, u
     auto &factory = OperationFactory::instance();
     OperationFactory::Param param{inputCount, inputs, outputCount, outputs};
 
-    switch (type)
-    {
-      case ANEURALNETWORKS_CAST_EX:
-      {
-        auto node = factory.create(type, param);
-        _model->addOperation(std::unique_ptr<neurun::model::operation::Node>{node});
-
-        break;
-      }
-      default:
-        throw std::runtime_error{"Not supported operation"};
-    }
+    auto node = factory.create(type, param);
+    _model->addOperation(std::unique_ptr<neurun::model::operation::Node>{node});
   }
   catch (const std::exception &e)
   {