diff options
author | Tay Ray Chuan <rctay89@gmail.com> | 2011-08-01 12:20:10 +0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-08 13:00:17 -0700 |
commit | 6486a84cb8e69ddf03b2139db3d968400e05f5b3 (patch) | |
tree | 55c50f22675c61d42f70420f3c91619e078f0d41 /xdiff/xhistogram.c | |
parent | xdiff/xhistogram: rely on xdl_trim_ends() (diff) | |
download | tgif-6486a84cb8e69ddf03b2139db3d968400e05f5b3.tar.xz |
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>
Diffstat (limited to 'xdiff/xhistogram.c')
-rw-r--r-- | xdiff/xhistogram.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index 130ceeed88..18f6f997c3 100644 --- a/xdiff/xhistogram.c +++ b/xdiff/xhistogram.c @@ -323,11 +323,10 @@ static int histogram_diff(xpparam_t const *xpp, xdfenv_t *env, result = fall_back_to_classic_diff(&index, line1, count1, line2, count2); else { if (lcs.begin1 == 0 && lcs.begin2 == 0) { - int ptr; - for (ptr = 0; ptr < count1; ptr++) - env->xdf1.rchg[line1 + ptr - 1] = 1; - for (ptr = 0; ptr < count2; ptr++) - env->xdf2.rchg[line2 + ptr - 1] = 1; + while (count1--) + env->xdf1.rchg[line1++ - 1] = 1; + while (count2--) + env->xdf2.rchg[line2++ - 1] = 1; result = 0; } else { result = histogram_diff(xpp, env, |