Skip to content

Commit 44332ae

Browse files
phillipwoodgitster
authored andcommitted
xdiff: cleanup xdl_clean_mmatch()
Remove the "s" parameter as, since the last commit, this function is always called with s == 0. Also change parameter "e" to expect a length, rather than the index of the last line to simplify the caller. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent dadccae commit 44332ae

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

xdiff/xprepare.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ void xdl_free_env(xdfenv_t *xe) {
197197
}
198198

199199

200-
static bool xdl_clean_mmatch(uint8_t const *action, ptrdiff_t i, ptrdiff_t s, ptrdiff_t e) {
200+
static bool xdl_clean_mmatch(uint8_t const *action, ptrdiff_t i, ptrdiff_t len) {
201201
ptrdiff_t r, rdis0, rpdis0, rdis1, rpdis1;
202+
ptrdiff_t s = 0, e = len - 1;
202203

203204
/*
204205
* Limits the window that is examined during the similar-lines
@@ -333,7 +334,7 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
333334
xdf1->nreff = 0;
334335
for (i = 0; i < len1; i++) {
335336
if (action1[i] == INVESTIGATE) {
336-
if (!xdl_clean_mmatch(action1, i, 0, len1 - 1))
337+
if (!xdl_clean_mmatch(action1, i, len1))
337338
action1[i] = KEEP;
338339
else
339340
action1[i] = DISCARD;
@@ -351,7 +352,7 @@ static int xdl_cleanup_records(xdlclassifier_t *cf, xdfile_t *xdf1, xdfile_t *xd
351352
xdf2->nreff = 0;
352353
for (i = 0; i < len2; i++) {
353354
if (action2[i] == INVESTIGATE) {
354-
if (!xdl_clean_mmatch(action2, i, 0, len2 - 1))
355+
if (!xdl_clean_mmatch(action2, i, len2))
355356
action2[i] = KEEP;
356357
else
357358
action2[i] = DISCARD;

0 commit comments

Comments
 (0)