mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
dedupeCatchup: only call when necessary at runtime
This commit is contained in:
parent
cd133f77ee
commit
314da68085
@ -76,10 +76,9 @@ enum DedupeResult dedupeCatchup(const struct RoseEngine *rose,
|
|||||||
from_offset, to_offset, ri->dkey, do_som);
|
from_offset, to_offset, ri->dkey, do_som);
|
||||||
DEBUG_PRINTF("report type=%u, quashSom=%d\n", ri->type, ri->quashSom);
|
DEBUG_PRINTF("report type=%u, quashSom=%d\n", ri->type, ri->quashSom);
|
||||||
const u32 dkey = ri->dkey;
|
const u32 dkey = ri->dkey;
|
||||||
if (!do_som && dkey == MO_INVALID_IDX) {
|
|
||||||
DEBUG_PRINTF("nothing to do\n");
|
// We should not have been called if there's no dedupe work to do.
|
||||||
return DEDUPE_CONTINUE;
|
assert(do_som || dkey != MO_INVALID_IDX);
|
||||||
}
|
|
||||||
|
|
||||||
struct match_deduper *deduper = &scratch->deduper;
|
struct match_deduper *deduper = &scratch->deduper;
|
||||||
if (offset != deduper->current_report_offset) {
|
if (offset != deduper->current_report_offset) {
|
||||||
@ -272,6 +271,7 @@ int roseAdaptor_i(u64a offset, ReportID id, struct hs_scratch *scratch,
|
|||||||
|
|
||||||
int halt = 0;
|
int halt = 0;
|
||||||
|
|
||||||
|
if (do_som || ri->dkey != MO_INVALID_IDX) {
|
||||||
enum DedupeResult dedupe_rv = dedupeCatchup(rose, ri, scratch, offset,
|
enum DedupeResult dedupe_rv = dedupeCatchup(rose, ri, scratch, offset,
|
||||||
from_offset, to_offset, do_som);
|
from_offset, to_offset, do_som);
|
||||||
switch (dedupe_rv) {
|
switch (dedupe_rv) {
|
||||||
@ -284,6 +284,7 @@ int roseAdaptor_i(u64a offset, ReportID id, struct hs_scratch *scratch,
|
|||||||
case DEDUPE_CONTINUE:
|
case DEDUPE_CONTINUE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
halt = ci->userCallback((unsigned int)ri->onmatch, from_offset, to_offset,
|
halt = ci->userCallback((unsigned int)ri->onmatch, from_offset, to_offset,
|
||||||
flags, ci->userContext);
|
flags, ci->userContext);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user