From 1392be048a8c6a5f8040435e18b293ab2bdd4266 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Thu, 29 Jun 2017 10:57:17 +1000 Subject: [PATCH] ng_width: use small_color_map --- src/nfagraph/ng_width.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nfagraph/ng_width.cpp b/src/nfagraph/ng_width.cpp index c2e9eb1a..4c33220c 100644 --- a/src/nfagraph/ng_width.cpp +++ b/src/nfagraph/ng_width.cpp @@ -37,6 +37,7 @@ #include "ue2common.h" #include "util/depth.h" #include "util/graph.h" +#include "util/graph_small_color_map.h" #include #include @@ -143,7 +144,7 @@ depth findMaxWidth(const NGHolder &h, const SpecialEdgeFilter &filter, assert(hasCorrectlyNumberedVertices(h)); const size_t num = num_vertices(h); vector distance(num); - vector colors(num); + auto colors = make_small_color_map(h); auto index_map = get(&NFAGraphVertexProps::index, g); @@ -151,15 +152,15 @@ depth findMaxWidth(const NGHolder &h, const SpecialEdgeFilter &filter, dag_shortest_paths(g, src, distance_map(make_iterator_property_map(distance.begin(), index_map)) .weight_map(boost::make_constant_property(-1)) - .color_map(make_iterator_property_map(colors.begin(), index_map))); + .color_map(colors)); depth acceptDepth, acceptEodDepth; - if (colors.at(NODE_ACCEPT) == boost::white_color) { + if (get(colors, h.accept) == small_color::white) { acceptDepth = depth::unreachable(); } else { acceptDepth = depth(-1 * distance.at(NODE_ACCEPT)); } - if (colors.at(NODE_ACCEPT_EOD) == boost::white_color) { + if (get(colors, h.acceptEod) == small_color::white) { acceptEodDepth = depth::unreachable(); } else { acceptEodDepth = depth(-1 * distance.at(NODE_ACCEPT_EOD));