#define INVESTIGATE 2
typedef struct s_xdlclass {
+ uint64_t line_hash;
struct s_xdlclass *next;
xrecord_t rec;
long idx;
}
-static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t *rec) {
+static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t *rec,
+ uint64_t line_hash) {
size_t hi;
xdlclass_t *rcrec;
- hi = XDL_HASHLONG(rec->line_hash, cf->hbits);
+ hi = XDL_HASHLONG(line_hash, cf->hbits);
for (rcrec = cf->rchash[hi]; rcrec; rcrec = rcrec->next)
- if (rcrec->rec.line_hash == rec->line_hash &&
+ if (rcrec->line_hash == line_hash &&
xdl_recmatch((const char *)rcrec->rec.ptr, (long)rcrec->rec.size,
(const char *)rec->ptr, (long)rec->size, cf->flags))
break;
if (XDL_ALLOC_GROW(cf->rcrecs, cf->count, cf->alloc))
return -1;
cf->rcrecs[rcrec->idx] = rcrec;
+ rcrec->line_hash = line_hash;
rcrec->rec = *rec;
rcrec->len1 = rcrec->len2 = 0;
rcrec->next = cf->rchash[hi];
crec = &xdf->recs[xdf->nrec++];
crec->ptr = prev;
crec->size = cur - prev;
- crec->line_hash = hav;
- if (xdl_classify_record(pass, cf, crec) < 0)
+ if (xdl_classify_record(pass, cf, crec, hav) < 0)
goto abort;
}
}