mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-07-13 22:14:45 +03:00
smwr: more aggressive pruning of overlong paths in NFA
This commit is contained in:
parent
725de51f89
commit
29ad557b9c
@ -198,15 +198,16 @@ static
|
|||||||
bool pruneOverlong(NGHolder &g, const depth &max_depth,
|
bool pruneOverlong(NGHolder &g, const depth &max_depth,
|
||||||
const ReportManager &rm) {
|
const ReportManager &rm) {
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
auto depths = calcDepths(g);
|
auto depths = calcBidiDepths(g);
|
||||||
|
|
||||||
for (auto v : vertices_range(g)) {
|
for (auto v : vertices_range(g)) {
|
||||||
if (is_special(v, g)) {
|
if (is_special(v, g)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const auto &d = depths.at(g[v].index);
|
const auto &d = depths.at(g[v].index);
|
||||||
depth min_depth = min(d.fromStart.min, d.fromStartDotStar.min);
|
depth min_match_offset = min(d.fromStart.min, d.fromStartDotStar.min)
|
||||||
if (min_depth > max_depth) {
|
+ min(d.toAccept.min, d.toAcceptEod.min);
|
||||||
|
if (min_match_offset > max_depth) {
|
||||||
clear_vertex(v, g);
|
clear_vertex(v, g);
|
||||||
modified = true;
|
modified = true;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user