mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
stream: simplify do_rebuild call site
This commit is contained in:
parent
76f72b6ab4
commit
cfa63a7096
@ -413,13 +413,9 @@ void ensureStreamNeatAndTidy(const struct RoseEngine *t, char *state,
|
|||||||
|
|
||||||
static really_inline
|
static really_inline
|
||||||
void do_rebuild(const struct RoseEngine *t, struct hs_scratch *scratch) {
|
void do_rebuild(const struct RoseEngine *t, struct hs_scratch *scratch) {
|
||||||
|
assert(t->drmatcherOffset);
|
||||||
assert(!can_stop_matching(scratch));
|
assert(!can_stop_matching(scratch));
|
||||||
|
|
||||||
if (!t->drmatcherOffset) {
|
|
||||||
DEBUG_PRINTF("no delayed rebuild table\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct HWLM *hwlm = getByOffset(t, t->drmatcherOffset);
|
const struct HWLM *hwlm = getByOffset(t, t->drmatcherOffset);
|
||||||
size_t len = MIN(scratch->core_info.hlen, t->delayRebuildLength);
|
size_t len = MIN(scratch->core_info.hlen, t->delayRebuildLength);
|
||||||
const u8 *buf = scratch->core_info.hbuf + scratch->core_info.hlen - len;
|
const u8 *buf = scratch->core_info.hbuf + scratch->core_info.hlen - len;
|
||||||
@ -641,15 +637,12 @@ void roseStreamExec(const struct RoseEngine *t, struct hs_scratch *scratch) {
|
|||||||
rebuild, scratch->core_info.status,
|
rebuild, scratch->core_info.status,
|
||||||
t->maxFloatingDelayedMatch, offset);
|
t->maxFloatingDelayedMatch, offset);
|
||||||
|
|
||||||
if (!flen) {
|
|
||||||
if (rebuild) { /* rebuild floating delayed match stuff */
|
if (rebuild) { /* rebuild floating delayed match stuff */
|
||||||
do_rebuild(t, scratch);
|
do_rebuild(t, scratch);
|
||||||
}
|
}
|
||||||
goto flush_delay_and_exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rebuild) { /* rebuild floating delayed match stuff */
|
if (!flen) {
|
||||||
do_rebuild(t, scratch);
|
goto flush_delay_and_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flen + offset <= t->floatingMinDistance) {
|
if (flen + offset <= t->floatingMinDistance) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user