Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
recs_match(): take two xrecord_t pointers as arguments
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 22 Aug 2016 11:22:43 +0000
(13:22 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 23 Aug 2016 20:51:47 +0000
(13:51 -0700)
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>
xdiff/xdiffi.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c06c0b6
)
diff --git
a/xdiff/xdiffi.c
b/xdiff/xdiffi.c
index ed2df640abb4a5334986a1c52e84a9e573ddc0d7..8a5832a99884a351ebf2e23717b7f7ecaea1cdd0 100644
(file)
--- 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);
}
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 (rec
s[ixs]->ha == recs[ix]
->ha &&
- xdl_recmatch(rec
s[ixs]->ptr, recs[ixs]
->size,
- rec
s[ix]->ptr, recs[ix]
->size,
+ return (rec
1->ha == rec2
->ha &&
+ xdl_recmatch(rec
1->ptr, rec1
->size,
+ rec
2->ptr, rec2
->size,
flags));
}
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.
*/
* 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;
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.
*/
* 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;
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) &&
*/
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]);
rchg[--ixs] = 1;
rchg[--ix] = 0;
while (rchgo[--ixo]);