mirror of
https://github.com/git/git.git
synced 2026-01-11 21:33:13 +09:00
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>
This commit is contained in:
parent
d1c028bdf7
commit
efaf553b1a
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user