ng_depth: rename calcDepth functions, return vec

This commit is contained in:
Justin Viiret
2017-05-01 14:57:05 +10:00
committed by Matthew Barr
parent 15c8a7bd98
commit dfe1b8a2af
14 changed files with 65 additions and 76 deletions

View File

@@ -118,13 +118,12 @@ struct ReachSubgraph {
static
void findInitDepths(const NGHolder &g,
ue2::unordered_map<NFAVertex, NFAVertexDepth> &depths) {
vector<NFAVertexDepth> d;
calcDepths(g, d);
auto d = calcDepths(g);
for (auto v : vertices_range(g)) {
u32 idx = g[v].index;
size_t idx = g[v].index;
assert(idx < d.size());
depths.insert(make_pair(v, d[idx]));
depths.emplace(v, d[idx]);
}
}