mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-02 04:27:42 +03:00
dfa: prune_overlong -> clear_deeper_reports
Rather than pruning states, we simply clear reports on states that are too deep and allow Hopcroft minimisation to reduce the size of the DFA afterwards.
This commit is contained in:
committed by
Matthew Barr
parent
8650a1a33f
commit
41d7aa8281
@@ -279,7 +279,7 @@ void SmallWriteBuildImpl::add(const NGHolder &g, const ExpressionInfo &expr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prune_overlong(*r, cc.grey.smallWriteLargestBuffer)) {
|
||||
if (clear_deeper_reports(*r, cc.grey.smallWriteLargestBuffer)) {
|
||||
minimize_hopcroft(*r, cc.grey);
|
||||
}
|
||||
|
||||
@@ -725,7 +725,7 @@ bytecode_ptr<NFA> prepEngine(raw_dfa &rdfa, u32 roseQuality,
|
||||
if (*small_region <= *start_offset) {
|
||||
return nullptr;
|
||||
}
|
||||
if (prune_overlong(rdfa, *small_region - *start_offset)) {
|
||||
if (clear_deeper_reports(rdfa, *small_region - *start_offset)) {
|
||||
minimize_hopcroft(rdfa, cc.grey);
|
||||
if (rdfa.start_anchored == DEAD_STATE) {
|
||||
DEBUG_PRINTF("all patterns pruned out\n");
|
||||
|
Reference in New Issue
Block a user