Skip to content

Commit 09fb5b2

Browse files
committed
recs_match(): take two xrecord_t pointers as arguments
There is no reason for it to take an array and two indexes as argument, as it only accesses two elements of the array. Original Git commit: 152598cbb667471c8f5be16e199922a41452b2d5
1 parent 506bf09 commit 09fb5b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/xdiff/xdiffi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
404404
}
405405

406406

407-
static int recs_match(xrecord_t **recs, long ixs, long ix, long flags)
407+
static int recs_match(xrecord_t *rec1, xrecord_t *rec2, long flags)
408408
{
409-
return (recs[ixs]->ha == recs[ix]->ha &&
410-
xdl_recmatch(recs[ixs]->ptr, recs[ixs]->size,
411-
recs[ix]->ptr, recs[ix]->size,
409+
return (rec1->ha == rec2->ha &&
410+
xdl_recmatch(rec1->ptr, rec1->size,
411+
rec2->ptr, rec2->size,
412412
flags));
413413
}
414414

@@ -454,7 +454,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
454454
* the last line of the current change group, shift backward
455455
* the group.
456456
*/
457-
while (ixs > 0 && recs_match(recs, ixs - 1, ix - 1, flags)) {
457+
while (ixs > 0 && recs_match(recs[ixs - 1], recs[ix - 1], flags)) {
458458
rchg[--ixs] = 1;
459459
rchg[--ix] = 0;
460460

@@ -481,7 +481,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
481481
* the line next of the current change group, shift forward
482482
* the group.
483483
*/
484-
while (ix < nrec && recs_match(recs, ixs, ix, flags)) {
484+
while (ix < nrec && recs_match(recs[ixs], recs[ix], flags)) {
485485
rchg[ixs++] = 0;
486486
rchg[ix++] = 1;
487487

0 commit comments

Comments
 (0)