##// END OF EJS Templates
bdiff: unify duplicate normalize loops...
Matt Mackall -
r29010:e868d8ee stable
parent child Browse files
Show More
@@ -264,16 +264,11 b' static int diff(struct line *a, int an, '
264 if (!next)
264 if (!next)
265 break;
265 break;
266
266
267 if (curr->a2 == next->a1)
267 if (curr->a2 == next->a1 || curr->b2 == next->b1)
268 while (curr->a2 + shift < an && curr->b2 + shift < bn
268 while (curr->a2 + shift < an && curr->b2 + shift < bn
269 && !cmp(a + curr->a2 + shift,
269 && !cmp(a + curr->a2 + shift,
270 b + curr->b2 + shift))
270 b + curr->b2 + shift))
271 shift++;
271 shift++;
272 else if (curr->b2 == next->b1)
273 while (curr->b2 + shift < bn && curr->a2 + shift < an
274 && !cmp(b + curr->b2 + shift,
275 a + curr->a2 + shift))
276 shift++;
277 if (!shift)
272 if (!shift)
278 continue;
273 continue;
279 curr->b2 += shift;
274 curr->b2 += shift;
General Comments 0
You need to be logged in to leave comments. Login now