summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 739864b)
raw | patch | inline | side by side (parent: 739864b)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Mon, 1 Aug 2011 04:20:08 +0000 (12:20 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Aug 2011 20:00:17 +0000 (13:00 -0700) |
Previously we were over-complicating matters by trying to combine the
recursed results. Now, terminate immediately if a recursive call failed
and return its result.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
recursed results. Now, terminate immediately if a recursive call failed
and return its result.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xhistogram.c | patch | blob | history |
diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c
index 391333a1a44892547be93d71cad59a7505e86e78..4cfafa1b3ae5669a0f2844ffb60a044c96f34db6 100644 (file)
--- a/xdiff/xhistogram.c
+++ b/xdiff/xhistogram.c
if (find_lcs(&index, &lcs, line1, count1, line2, count2))
result = fall_back_to_classic_diff(&index, line1, count1, line2, count2);
else {
- result = 0;
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;
+ result = 0;
} else {
result = histogram_diff(xpp, env,
- line1, lcs.begin1 - line1,
- line2, lcs.begin2 - line2);
+ line1, lcs.begin1 - line1,
+ line2, lcs.begin2 - line2);
+ if (result)
+ goto cleanup;
result = histogram_diff(xpp, env,
- lcs.end1 + 1, LINE_END(1) - lcs.end1,
- lcs.end2 + 1, LINE_END(2) - lcs.end2);
- result *= -1;
+ lcs.end1 + 1, LINE_END(1) - lcs.end1,
+ lcs.end2 + 1, LINE_END(2) - lcs.end2);
+ if (result)
+ goto cleanup;
}
}