Show More
@@ -148,7 +148,7 b' static int equatelines(struct line *a, i' | |||||
148 | static int longest_match(struct line *a, struct line *b, struct pos *pos, |
|
148 | static int longest_match(struct line *a, struct line *b, struct pos *pos, | |
149 | int a1, int a2, int b1, int b2, int *omi, int *omj) |
|
149 | int a1, int a2, int b1, int b2, int *omi, int *omj) | |
150 | { |
|
150 | { | |
151 |
int mi = a1, mj = b1, mk = 0, |
|
151 | int mi = a1, mj = b1, mk = 0, i, j, k, half; | |
152 |
|
152 | |||
153 | /* window our search on large regions to better bound |
|
153 | /* window our search on large regions to better bound | |
154 | worst-case performance. by choosing a window at the end, we |
|
154 | worst-case performance. by choosing a window at the end, we | |
@@ -195,18 +195,15 b' static int longest_match(struct line *a,' | |||||
195 | mj = mj - mk + 1; |
|
195 | mj = mj - mk + 1; | |
196 | } |
|
196 | } | |
197 |
|
197 | |||
198 |
/* expand match to include |
|
198 | /* expand match to include subsequent popular lines */ | |
199 | while (mi - mb > a1 && mj - mb > b1 && |
|
|||
200 | a[mi - mb - 1].e == b[mj - mb - 1].e) |
|
|||
201 | mb++; |
|
|||
202 | while (mi + mk < a2 && mj + mk < b2 && |
|
199 | while (mi + mk < a2 && mj + mk < b2 && | |
203 | a[mi + mk].e == b[mj + mk].e) |
|
200 | a[mi + mk].e == b[mj + mk].e) | |
204 | mk++; |
|
201 | mk++; | |
205 |
|
202 | |||
206 |
*omi = mi |
|
203 | *omi = mi; | |
207 |
*omj = mj |
|
204 | *omj = mj; | |
208 |
|
205 | |||
209 |
return mk |
|
206 | return mk; | |
210 | } |
|
207 | } | |
211 |
|
208 | |||
212 | static struct hunk *recurse(struct line *a, struct line *b, struct pos *pos, |
|
209 | static struct hunk *recurse(struct line *a, struct line *b, struct pos *pos, |
General Comments 0
You need to be logged in to leave comments.
Login now