[neurun] Make initializeUseDef less verbose (#2546)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 3 Sep 2018 01:11:37 +0000 (10:11 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 3 Sep 2018 01:11:37 +0000 (10:11 +0900)
Make `Graph::initializeUseDef` implementation less verbose via using
directly a lambda function.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/graph/Graph.cc

index 4ed9c42..5db6e5c 100644 (file)
@@ -140,9 +140,7 @@ std::unique_ptr<linear::Linear> Graph::linearize(void)
 
 void Graph::initializeUseDef()
 {
-  std::function<void(const operation::Index &index, const operation::Node &node)> initUseDef =
-      [&](const operation::Index &index, const operation::Node &node) -> void {
-
+  operations().iterate([&](const operation::Index &index, const operation::Node &node) -> void {
     auto outputs = node.getOutputs();
     for (auto output : outputs.list())
     {
@@ -154,9 +152,7 @@ void Graph::initializeUseDef()
     {
       operands().at(input).appendUse(index);
     }
-  };
-
-  operations().iterate(initUseDef);
+  });
 }
 
 } // namespace graph