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>
Michael Haggerty committed
Aug 22, 2016 at 13:22 UTC
c06c0b634360935286de2767f7edaf953bbf16ce
1 file changed
+4
-4
xdiff/xdiffi.c
+4
-4
@@ -400,9 +400,9 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
400
}
401
402
403
-static int is_blank_line(xrecord_t **recs, long ix, long flags)
403
+static int is_blank_line(xrecord_t *rec, long flags)
404
{
405
- return xdl_blankline(recs[ix]->ptr, recs[ix]->size, flags);
405
+ return xdl_blankline(rec->ptr, rec->size, flags);
406
}
407
408
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) {
485
* the group.
486
*/
487
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);
489
490
rchg[ixs++] = 0;
491
rchg[ix++] = 1;
@@ -524,7 +524,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
524
* back only if at all.
525
*/
526
while (ixs > 0 &&
527
- !is_blank_line(recs, ix - 1, flags) &&
527
+ !is_blank_line(recs[ix - 1], flags) &&
528
recs_match(recs, ixs - 1, ix - 1, flags)) {
529
rchg[--ixs] = 1;
530
rchg[--ix] = 0;