summaryrefslogtreecommitdiff
path: root/xdiff/xdiffi.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-08-22 11:22:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-23 20:51:47 (GMT)
commit152598cbb667471c8f5be16e199922a41452b2d5 (patch)
treea7f41fef6724ab5c36dd07581d8e594e4ed2ef22 /xdiff/xdiffi.c
parentc06c0b634360935286de2767f7edaf953bbf16ce (diff)
downloadgit-152598cbb667471c8f5be16e199922a41452b2d5.zip
git-152598cbb667471c8f5be16e199922a41452b2d5.tar.gz
git-152598cbb667471c8f5be16e199922a41452b2d5.tar.bz2
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. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff/xdiffi.c')
-rw-r--r--xdiff/xdiffi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index ed2df64..8a5832a 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -405,11 +405,11 @@ static int is_blank_line(xrecord_t *rec, long flags)
return xdl_blankline(rec->ptr, rec->size, flags);
}
-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));
}
@@ -457,7 +457,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;
@@ -484,7 +484,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)) {
blank_lines += is_blank_line(recs[ix], flags);
rchg[ixs++] = 0;
@@ -525,7 +525,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
*/
while (ixs > 0 &&
!is_blank_line(recs[ix - 1], flags) &&
- recs_match(recs, ixs - 1, ix - 1, flags)) {
+ recs_match(recs[ixs - 1], recs[ix - 1], flags)) {
rchg[--ixs] = 1;
rchg[--ix] = 0;
while (rchgo[--ixo]);