]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
ng_util: make more use of small_color_map in DFS
authorJustin Viiret <justin.viiret@intel.com>
Thu, 29 Jun 2017 01:38:13 +0000 (11:38 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:12:26 +0000 (11:12 +1000)
src/nfagraph/ng_util.cpp

index 197ac66de5c566ac77f4d4323a77238e0587b7b2..14082407d79b84426a21cf98548460bef0892e3a 100644 (file)
@@ -214,8 +214,8 @@ bool isFloating(const NGHolder &g) {
 
 bool isAcyclic(const NGHolder &g) {
     try {
-        boost::depth_first_search(g, visitor(DetectCycles(g))
-                                     .root_vertex(g.start));
+        boost::depth_first_search(g, DetectCycles(g), make_small_color_map(g),
+                                  g.start);
     } catch (const CycleFound &) {
         return false;
     }
@@ -243,7 +243,8 @@ bool hasBigCycles(const NGHolder &g) {
     assert(hasCorrectlyNumberedVertices(g));
     set<NFAEdge> dead;
     BackEdges<set<NFAEdge>> backEdgeVisitor(dead);
-    boost::depth_first_search(g, visitor(backEdgeVisitor).root_vertex(g.start));
+    boost::depth_first_search(g, backEdgeVisitor, make_small_color_map(g),
+                              g.start);
 
     for (const auto &e : dead) {
         if (source(e, g) != target(e, g)) {