Skip to content

Commit

Permalink
xdiff/xhistogram: drop need for additional variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tay Ray Chuan authored and Junio C Hamano committed Aug 8, 2011
1 parent 43ca753 commit 6486a84
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xdiff/xhistogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6486a84

Please sign in to comment.