From 8eb55d4242c31428a19a84d93afa90cb9582cf83 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Thu, 3 Aug 2017 15:52:25 +1000 Subject: [PATCH] rose_build_exclusive: clean up use of vertex indices --- src/rose/rose_build_exclusive.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/rose/rose_build_exclusive.cpp b/src/rose/rose_build_exclusive.cpp index 4c8796f5..6a5a710d 100644 --- a/src/rose/rose_build_exclusive.cpp +++ b/src/rose/rose_build_exclusive.cpp @@ -219,29 +219,29 @@ bool isExclusive(const NGHolder &h, const auto &cr1 = role1.cr; if (overlaps(cr1, role2.last_cr)) { CharReach cr = cr1 | role1.prefix_cr; + flat_set states; for (const auto &lit : triggers2) { auto lit1 = findStartPos(cr, lit); if (lit1.empty()) { continue; } - u32 lower_bound = 0; - if (lit1.size() < lit.size()) { - lower_bound = ~0U; - } - flat_set states; - for (const auto &v : vertices_range(h)) { - if (h[v].index >= lower_bound || h[v].index < 2) { - states.insert(v); - } + states.clear(); + + if (lit1.size() < lit.size()) { + // Only starts. + states.insert(h.start); + states.insert(h.startDs); + } else { + // All vertices. + insert(&states, vertices(h)); } auto activeStates = execute_graph(h, lit1, states); - // Check if has only literal states are on + // Check if only literal states are on for (const auto &s : activeStates) { - u32 stateId = h[s].index; - if ((stateId > 1 && stateId <= num) || - contains(tailId, stateId)) { + if ((!is_any_start(s, h) && h[s].index <= num) || + contains(tailId, h[s].index)) { skipList[id2].insert(id1); return false; }