Skip to content

Commit 6486a84

Browse files
rctaygitster
authored andcommitted
xdiff/xhistogram: drop need for additional variable
Having an additional variable (ptr) instead of changing line(1|2) and count(1|2) was for debugging purposes. Signed-off-by: Tay Ray Chuan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43ca753 commit 6486a84

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

xdiff/xhistogram.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,10 @@ static int histogram_diff(xpparam_t const *xpp, xdfenv_t *env,
323323
result = fall_back_to_classic_diff(&index, line1, count1, line2, count2);
324324
else {
325325
if (lcs.begin1 == 0 && lcs.begin2 == 0) {
326-
int ptr;
327-
for (ptr = 0; ptr < count1; ptr++)
328-
env->xdf1.rchg[line1 + ptr - 1] = 1;
329-
for (ptr = 0; ptr < count2; ptr++)
330-
env->xdf2.rchg[line2 + ptr - 1] = 1;
326+
while (count1--)
327+
env->xdf1.rchg[line1++ - 1] = 1;
328+
while (count2--)
329+
env->xdf2.rchg[line2++ - 1] = 1;
331330
result = 0;
332331
} else {
333332
result = histogram_diff(xpp, env,

0 commit comments

Comments
 (0)