mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
smallwrite: minimize DFAs if they have been pruned
This commit is contained in:
parent
c67a361080
commit
054749f9ee
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "grey.h"
|
#include "grey.h"
|
||||||
#include "ue2common.h"
|
#include "ue2common.h"
|
||||||
|
#include "nfa/dfa_min.h"
|
||||||
#include "nfa/mcclellancompile.h"
|
#include "nfa/mcclellancompile.h"
|
||||||
#include "nfa/mcclellancompile_util.h"
|
#include "nfa/mcclellancompile_util.h"
|
||||||
#include "nfa/nfa_internal.h"
|
#include "nfa/nfa_internal.h"
|
||||||
@ -208,7 +209,9 @@ void SmallWriteBuildImpl::add(const NGWrapper &w) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
prune_overlong(*r, cc.grey.smallWriteLargestBuffer);
|
if (prune_overlong(*r, cc.grey.smallWriteLargestBuffer)) {
|
||||||
|
minimize_hopcroft(*r, cc.grey);
|
||||||
|
}
|
||||||
|
|
||||||
if (rdfa) {
|
if (rdfa) {
|
||||||
// do a merge of the new dfa with the existing dfa
|
// do a merge of the new dfa with the existing dfa
|
||||||
@ -418,6 +421,7 @@ aligned_unique_ptr<NFA> prepEngine(raw_dfa &rdfa, u32 roseQuality,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (prune_overlong(rdfa, *small_region - *start_offset)) {
|
if (prune_overlong(rdfa, *small_region - *start_offset)) {
|
||||||
|
minimize_hopcroft(rdfa, cc.grey);
|
||||||
if (rdfa.start_anchored == DEAD_STATE) {
|
if (rdfa.start_anchored == DEAD_STATE) {
|
||||||
DEBUG_PRINTF("all patterns pruned out\n");
|
DEBUG_PRINTF("all patterns pruned out\n");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user