From: Justin Viiret Date: Thu, 29 Jun 2017 01:43:45 +0000 (+1000) Subject: ng_depth: use small_color_map in findLoopReachable X-Git-Tag: v4.6.0^2~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90faea4ce98b9bdc2d3fdca4cd3b82e9a17832fd;p=thirdparty%2Fvectorscan.git ng_depth: use small_color_map in findLoopReachable --- diff --git a/src/nfagraph/ng_depth.cpp b/src/nfagraph/ng_depth.cpp index 67a6b27b..aaa5166f 100644 --- a/src/nfagraph/ng_depth.cpp +++ b/src/nfagraph/ng_depth.cpp @@ -34,17 +34,18 @@ #include "ng_util.h" #include "ue2common.h" #include "util/graph_range.h" +#include "util/graph_small_color_map.h" #include #include +#include #include #include -#include #include +#include #include #include -#include #include using namespace std; @@ -137,13 +138,15 @@ vector findLoopReachable(const Graph &g, EdgeSet deadEdges; BackEdges be(deadEdges); - depth_first_search(g, visitor(be).root_vertex(src)); + auto colors = make_small_color_map(g); + + depth_first_search(g, be, colors, src); auto af = make_bad_edge_filter(&deadEdges); auto acyclic_g = make_filtered_graph(g, af); vector topoOrder; /* actually reverse topological order */ topoOrder.reserve(deadNodes.size()); - topological_sort(acyclic_g, back_inserter(topoOrder)); + topological_sort(acyclic_g, back_inserter(topoOrder), color_map(colors)); for (const auto &e : deadEdges) { size_t srcIdx = g[source(e, g)].index;