##// END OF EJS Templates
bdiff: further restrain potential quadratic performance...
Matt Mackall -
r29015:87d4a6c5 stable
parent child Browse files
Show More
@@ -148,7 +148,15 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, mb = 0, i, j, k, half = (a1 + a2) / 2;
151 int mi = a1, mj = b1, mk = 0, mb = 0, i, j, k, half;
152
153 /* window our search on large regions to better bound
154 worst-case performance. by choosing a window at the end, we
155 reduce skipping overhead on the b chains. */
156 if (a2 - a1 > 30000)
157 a1 = a2 - 30000;
158
159 half = (a1 + a2) / 2;
152
160
153 for (i = a1; i < a2; i++) {
161 for (i = a1; i < a2; i++) {
154 /* skip all lines in b after the current block */
162 /* skip all lines in b after the current block */
General Comments 0
You need to be logged in to leave comments. Login now