mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 18:44:24 +03:00
ng_literal_decorated: pre-check for narrow reach
This commit is contained in:
committed by
Matthew Barr
parent
5a7d5958d1
commit
5837f68b9a
@@ -257,6 +257,12 @@ bool hasBigCycles(const NGHolder &g) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasNarrowReachVertex(const NGHolder &g, size_t max_reach_count) {
|
||||
return any_of_in(vertices_range(g), [&](NFAVertex v) {
|
||||
return !is_special(v, g) && g[v].char_reach.count() < max_reach_count;
|
||||
});
|
||||
}
|
||||
|
||||
bool can_never_match(const NGHolder &g) {
|
||||
assert(edge(g.accept, g.acceptEod, g).second);
|
||||
if (in_degree(g.accept, g) == 0 && in_degree(g.acceptEod, g) == 1) {
|
||||
|
||||
Reference in New Issue
Block a user