Skip to content
Snippets Groups Projects
Commit d29cb5e7 authored by Matt Mackall's avatar Matt Mackall
Browse files

bdiff: remove effectively dead code

Now that we extend matches backwards in the inner loop, the final
adjustment has no effect.

(A similar extension for the forward direction is trickier and has
less benefit.)
parent 66dbdd3c
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@
static int longest_match(struct line *a, struct line *b, struct pos *pos,
int a1, int a2, int b1, int b2, int *omi, int *omj)
{
int mi = a1, mj = b1, mk = 0, mb = 0, i, j, k, half;
int mi = a1, mj = b1, mk = 0, i, j, k, half;
/* window our search on large regions to better bound
worst-case performance. by choosing a window at the end, we
......@@ -195,11 +195,8 @@
mj = mj - mk + 1;
}
/* expand match to include neighboring popular lines */
while (mi - mb > a1 && mj - mb > b1 &&
a[mi - mb - 1].e == b[mj - mb - 1].e)
mb++;
/* expand match to include subsequent popular lines */
while (mi + mk < a2 && mj + mk < b2 &&
a[mi + mk].e == b[mj + mk].e)
mk++;
......@@ -202,7 +199,7 @@
while (mi + mk < a2 && mj + mk < b2 &&
a[mi + mk].e == b[mj + mk].e)
mk++;
*omi = mi - mb;
*omj = mj - mb;
*omi = mi;
*omj = mj;
......@@ -208,5 +205,5 @@
return mk + mb;
return mk;
}
static struct hunk *recurse(struct line *a, struct line *b, struct pos *pos,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment