diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:14 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:14 -0800 |
commit | a0f5ca94dd27fb3636bddde251ce3db0a18fc49e (patch) | |
tree | 5aff7ce591cea270d056ccbdabae5beb7697ffc2 /xdiff/xhistogram.c | |
parent | The third batch (diff) | |
parent | xdiff: drop unused flags parameter from recs_match (diff) | |
download | tgif-a0f5ca94dd27fb3636bddde251ce3db0a18fc49e.tar.xz |
Merge branch 'pw/xdiff-classify-record-in-histogram'
"diff --histogram" optimization.
* pw/xdiff-classify-record-in-histogram:
xdiff: drop unused flags parameter from recs_match
xdiff: drop xpparam_t parameter from histogram cmp_recs()
xdiff: drop CMP_ENV macro from xhistogram
xdiff: simplify comparison
xdiff: avoid unnecessary memory allocations
diff histogram: intern strings
Diffstat (limited to 'xdiff/xhistogram.c')
-rw-r--r-- | xdiff/xhistogram.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index e694bfd9e3..80794748b0 100644 --- a/xdiff/xhistogram.c +++ b/xdiff/xhistogram.c @@ -88,19 +88,14 @@ struct region { #define REC(env, s, l) \ (env->xdf##s.recs[l - 1]) -static int cmp_recs(xpparam_t const *xpp, - xrecord_t *r1, xrecord_t *r2) +static int cmp_recs(xrecord_t *r1, xrecord_t *r2) { - return r1->ha == r2->ha && - xdl_recmatch(r1->ptr, r1->size, r2->ptr, r2->size, - xpp->flags); -} + return r1->ha == r2->ha; -#define CMP_ENV(xpp, env, s1, l1, s2, l2) \ - (cmp_recs(xpp, REC(env, s1, l1), REC(env, s2, l2))) +} #define CMP(i, s1, l1, s2, l2) \ - (cmp_recs(i->xpp, REC(i->env, s1, l1), REC(i->env, s2, l2))) + (cmp_recs(REC(i->env, s1, l1), REC(i->env, s2, l2))) #define TABLE_HASH(index, side, line) \ XDL_HASHLONG((REC(index->env, side, line))->ha, index->table_bits) |