Skip to content

Commit c06c0b6

Browse files
mhaggergitster
authored andcommitted
is_blank_line(): take a single xrecord_t as argument
There is no reason for it to take an array and index as argument, as it only accesses a single element of the array. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cb0eded commit c06c0b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xdiff/xdiffi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
400400
}
401401

402402

403-
static int is_blank_line(xrecord_t **recs, long ix, long flags)
403+
static int is_blank_line(xrecord_t *rec, long flags)
404404
{
405-
return xdl_blankline(recs[ix]->ptr, recs[ix]->size, flags);
405+
return xdl_blankline(rec->ptr, rec->size, flags);
406406
}
407407

408408
static int recs_match(xrecord_t **recs, long ixs, long ix, long flags)
@@ -485,7 +485,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
485485
* the group.
486486
*/
487487
while (ix < nrec && recs_match(recs, ixs, ix, flags)) {
488-
blank_lines += is_blank_line(recs, ix, flags);
488+
blank_lines += is_blank_line(recs[ix], flags);
489489

490490
rchg[ixs++] = 0;
491491
rchg[ix++] = 1;
@@ -524,7 +524,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
524524
* back only if at all.
525525
*/
526526
while (ixs > 0 &&
527-
!is_blank_line(recs, ix - 1, flags) &&
527+
!is_blank_line(recs[ix - 1], flags) &&
528528
recs_match(recs, ixs - 1, ix - 1, flags)) {
529529
rchg[--ixs] = 1;
530530
rchg[--ix] = 0;

0 commit comments

Comments
 (0)