Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
is_blank_line(): take a single xrecord_t as argument
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 22 Aug 2016 11:22:42 +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 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>
xdiff/xdiffi.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cb0eded
)
diff --git
a/xdiff/xdiffi.c
b/xdiff/xdiffi.c
index 61deed8d4b544aad3dc719a92d5756c23ac0c889..ed2df640abb4a5334986a1c52e84a9e573ddc0d7 100644
(file)
--- a/
xdiff/xdiffi.c
+++ b/
xdiff/xdiffi.c
@@
-400,9
+400,9
@@
static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
}
}
-static int is_blank_line(xrecord_t *
*recs, long ix
, long flags)
+static int is_blank_line(xrecord_t *
rec
, long flags)
{
{
- return xdl_blankline(rec
s[ix]->ptr, recs[ix]
->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 **recs, long ixs, long ix, long flags)
@@
-485,7
+485,7
@@
int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
* the group.
*/
while (ix < nrec && recs_match(recs, ixs, ix, flags)) {
* the group.
*/
while (ix < nrec && recs_match(recs, ixs, ix, flags)) {
- blank_lines += is_blank_line(recs
, ix
, flags);
+ blank_lines += is_blank_line(recs
[ix]
, flags);
rchg[ixs++] = 0;
rchg[ix++] = 1;
rchg[ixs++] = 0;
rchg[ix++] = 1;
@@
-524,7
+524,7
@@
int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
* back only if at all.
*/
while (ixs > 0 &&
* back only if at all.
*/
while (ixs > 0 &&
- !is_blank_line(recs
, ix - 1
, flags) &&
+ !is_blank_line(recs
[ix - 1]
, flags) &&
recs_match(recs, ixs - 1, ix - 1, flags)) {
rchg[--ixs] = 1;
rchg[--ix] = 0;
recs_match(recs, ixs - 1, ix - 1, flags)) {
rchg[--ixs] = 1;
rchg[--ix] = 0;