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 <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tay Ray Chuan committed
Aug 1, 2011 at 12:20 UTC
6486a84cb8e69ddf03b2139db3d968400e05f5b3
1 file changed
+4
-5
xdiff/xhistogram.c
+4
-5
@@ -323,11 +323,10 @@ static int histogram_diff(xpparam_t const *xpp, xdfenv_t *env,
323
result = fall_back_to_classic_diff(&index, line1, count1, line2, count2);
324
else {
325
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;
330
result = 0;
331
} else {
332
result = histogram_diff(xpp, env,