simple pass to pick up paths redundant with those from cyclic's succs

This commit is contained in:
Alex Coyte
2016-10-06 15:54:48 +11:00
committed by Matthew Barr
parent 8cadba0bdd
commit 47f53f63a7
13 changed files with 234 additions and 68 deletions

View File

@@ -382,8 +382,7 @@ bool transformMinLengthToRepeat(const ReportManager &rm, NGWrapper &g) {
while (v != cyclic) {
DEBUG_PRINTF("vertex %u\n", g[v].index);
width++;
tie(ai, ae) = adjacent_vertices(v, g);
set<NFAVertex> succ(ai, ae);
auto succ = succs(v, g);
if (contains(succ, cyclic)) {
if (succ.size() == 1) {
v = cyclic;
@@ -421,8 +420,7 @@ bool transformMinLengthToRepeat(const ReportManager &rm, NGWrapper &g) {
while (!is_any_accept(v, g)) {
DEBUG_PRINTF("vertex %u\n", g[v].index);
width++;
tie(ai, ae) = adjacent_vertices(v, g);
set<NFAVertex> succ(ai, ae);
auto succ = succs(v, g);
if (succ.size() != 1) {
DEBUG_PRINTF("bad form\n");
return false;