diff --git a/src/common/depCore.h b/src/common/depCore.h index 3d7948cc835e9c4f1ac4670c6bd600028f2f48c1..d9873a3896d1ac83cfc45e0666ca8491a645ed8e 100644 --- a/src/common/depCore.h +++ b/src/common/depCore.h @@ -28,14 +28,6 @@ class depCore { const std::vector>>& ops) { std::unordered_map vars; size_t nop = ops.size(); - for (size_t i = 0; i < nop; i++) { - const auto& op = ops[i]; - for (const auto& kv : op->Outputs()) { - for (const auto& v : kv.second) { - vars[v] = i; - } - } - } deps.resize(nop); next.resize(nop); for (size_t i = 0; i < nop; i++) { @@ -56,6 +48,11 @@ class depCore { next[di].push_back(i); } } + for (const auto& kv : op->Outputs()) { + for (const auto& v : kv.second) { + vars[v] = i; + } + } } } const std::vector& getNext(int i) { return next[i]; }