diff options
| author | Ezekiel Newren <ezekielnewren@gmail.com> | 2025-09-26 22:41:50 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-26 16:08:55 -0700 |
| commit | efaf553b1a4ea9cafcb9cab0697157091bc4825a (patch) | |
| tree | acf550be11e39185a68ddfba9e8ca497ae56353c | |
| parent | d1c028bdf75b9bcd380f85f74a34edcbaa060fee (diff) | |
xdiff: delete unnecessary fields from xrecord_t and xdfile_t
xrecord_t.next, xdfile_t.hbits, xdfile_t.rhash are initialized,
but never used for anything by the code. Remove them.
Best-viewed-with: --color-words
Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | xdiff/xprepare.c | 15 | ||||
| -rw-r--r-- | xdiff/xtypes.h | 3 |
2 files changed, 2 insertions, 16 deletions
diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c index 96134c9fbf..3576415c85 100644 --- a/xdiff/xprepare.c +++ b/xdiff/xprepare.c @@ -91,8 +91,7 @@ static void xdl_free_classifier(xdlclassifier_t *cf) { } -static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t **rhash, - unsigned int hbits, xrecord_t *rec) { +static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t *rec) { long hi; char const *line; xdlclass_t *rcrec; @@ -126,17 +125,12 @@ static int xdl_classify_record(unsigned int pass, xdlclassifier_t *cf, xrecord_t rec->ha = (unsigned long) rcrec->idx; - hi = (long) XDL_HASHLONG(rec->ha, hbits); - rec->next = rhash[hi]; - rhash[hi] = rec; - return 0; } static void xdl_free_ctx(xdfile_t *xdf) { - xdl_free(xdf->rhash); xdl_free(xdf->rindex); xdl_free(xdf->rchg - 1); xdl_free(xdf->ha); @@ -155,7 +149,6 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_ xdf->ha = NULL; xdf->rindex = NULL; xdf->rchg = NULL; - xdf->rhash = NULL; xdf->recs = NULL; if (xdl_cha_init(&xdf->rcha, sizeof(xrecord_t), narec / 4 + 1) < 0) @@ -163,10 +156,6 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_ if (!XDL_ALLOC_ARRAY(xdf->recs, narec)) goto abort; - xdf->hbits = xdl_hashbits((unsigned int) narec); - if (!XDL_CALLOC_ARRAY(xdf->rhash, 1 << xdf->hbits)) - goto abort; - xdf->nrec = 0; if ((cur = blk = xdl_mmfile_first(mf, &bsize))) { for (top = blk + bsize; cur < top; ) { @@ -180,7 +169,7 @@ static int xdl_prepare_ctx(unsigned int pass, mmfile_t *mf, long narec, xpparam_ crec->size = (long) (cur - prev); crec->ha = hav; xdf->recs[xdf->nrec++] = crec; - if (xdl_classify_record(pass, cf, xdf->rhash, xdf->hbits, crec) < 0) + if (xdl_classify_record(pass, cf, crec) < 0) goto abort; } } diff --git a/xdiff/xtypes.h b/xdiff/xtypes.h index 8442bd436e..8b8467360e 100644 --- a/xdiff/xtypes.h +++ b/xdiff/xtypes.h @@ -39,7 +39,6 @@ typedef struct s_chastore { } chastore_t; typedef struct s_xrecord { - struct s_xrecord *next; char const *ptr; long size; unsigned long ha; @@ -48,8 +47,6 @@ typedef struct s_xrecord { typedef struct s_xdfile { chastore_t rcha; long nrec; - unsigned int hbits; - xrecord_t **rhash; long dstart, dend; xrecord_t **recs; char *rchg; |
