mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
rose_build_exclusive: clean up use of vertex indices
This commit is contained in:
parent
d55e8fdf94
commit
8eb55d4242
@ -219,29 +219,29 @@ bool isExclusive(const NGHolder &h,
|
|||||||
const auto &cr1 = role1.cr;
|
const auto &cr1 = role1.cr;
|
||||||
if (overlaps(cr1, role2.last_cr)) {
|
if (overlaps(cr1, role2.last_cr)) {
|
||||||
CharReach cr = cr1 | role1.prefix_cr;
|
CharReach cr = cr1 | role1.prefix_cr;
|
||||||
|
flat_set<NFAVertex> states;
|
||||||
for (const auto &lit : triggers2) {
|
for (const auto &lit : triggers2) {
|
||||||
auto lit1 = findStartPos(cr, lit);
|
auto lit1 = findStartPos(cr, lit);
|
||||||
if (lit1.empty()) {
|
if (lit1.empty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
u32 lower_bound = 0;
|
|
||||||
if (lit1.size() < lit.size()) {
|
|
||||||
lower_bound = ~0U;
|
|
||||||
}
|
|
||||||
|
|
||||||
flat_set<NFAVertex> states;
|
states.clear();
|
||||||
for (const auto &v : vertices_range(h)) {
|
|
||||||
if (h[v].index >= lower_bound || h[v].index < 2) {
|
if (lit1.size() < lit.size()) {
|
||||||
states.insert(v);
|
// Only starts.
|
||||||
}
|
states.insert(h.start);
|
||||||
|
states.insert(h.startDs);
|
||||||
|
} else {
|
||||||
|
// All vertices.
|
||||||
|
insert(&states, vertices(h));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto activeStates = execute_graph(h, lit1, states);
|
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) {
|
for (const auto &s : activeStates) {
|
||||||
u32 stateId = h[s].index;
|
if ((!is_any_start(s, h) && h[s].index <= num) ||
|
||||||
if ((stateId > 1 && stateId <= num) ||
|
contains(tailId, h[s].index)) {
|
||||||
contains(tailId, stateId)) {
|
|
||||||
skipList[id2].insert(id1);
|
skipList[id2].insert(id1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user