summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-08-22 13:22:43 +0200
committerMichael Haggerty <mhagger@alum.mit.edu>2016-09-29 18:38:02 +0200
commit09fb5b2adaeeff001ee573bb78ce2c70a65e30f8 (patch)
treee1a558ff37e25593d26e4c83b85dbcbfe0700748
parent506bf09d51df9fd76b967dc963de626d033f3393 (diff)
downloadlibgit2-09fb5b2adaeeff001ee573bb78ce2c70a65e30f8.tar.gz
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
-rw-r--r--src/xdiff/xdiffi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xdiff/xdiffi.c b/src/xdiff/xdiffi.c
index dbfaf177c..f83e0c010 100644
--- a/src/xdiff/xdiffi.c
+++ b/src/xdiff/xdiffi.c
@@ -404,11 +404,11 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
}
-static int recs_match(xrecord_t **recs, long ixs, long ix, long flags)
+static int recs_match(xrecord_t *rec1, xrecord_t *rec2, long flags)
{
- return (recs[ixs]->ha == recs[ix]->ha &&
- xdl_recmatch(recs[ixs]->ptr, recs[ixs]->size,
- recs[ix]->ptr, recs[ix]->size,
+ return (rec1->ha == rec2->ha &&
+ xdl_recmatch(rec1->ptr, rec1->size,
+ rec2->ptr, rec2->size,
flags));
}
@@ -454,7 +454,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
* the last line of the current change group, shift backward
* the group.
*/
- while (ixs > 0 && recs_match(recs, ixs - 1, ix - 1, flags)) {
+ while (ixs > 0 && recs_match(recs[ixs - 1], recs[ix - 1], flags)) {
rchg[--ixs] = 1;
rchg[--ix] = 0;
@@ -481,7 +481,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
* the line next of the current change group, shift forward
* the group.
*/
- while (ix < nrec && recs_match(recs, ixs, ix, flags)) {
+ while (ix < nrec && recs_match(recs[ixs], recs[ix], flags)) {
rchg[ixs++] = 0;
rchg[ix++] = 1;