From f5e7951ad61310dc1c59f571941184f9203df3ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Mon, 3 Sep 2018 10:11:37 +0900 Subject: [PATCH] [neurun] Make initializeUseDef less verbose (#2546) Make `Graph::initializeUseDef` implementation less verbose via using directly a lambda function. Signed-off-by: Hanjoung Lee --- runtimes/neurun/src/graph/Graph.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/runtimes/neurun/src/graph/Graph.cc b/runtimes/neurun/src/graph/Graph.cc index 4ed9c42..5db6e5c 100644 --- a/runtimes/neurun/src/graph/Graph.cc +++ b/runtimes/neurun/src/graph/Graph.cc @@ -140,9 +140,7 @@ std::unique_ptr Graph::linearize(void) void Graph::initializeUseDef() { - std::function 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 -- 2.7.4