diff options
Diffstat (limited to 'lib/diffseq.h')
| -rw-r--r-- | lib/diffseq.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/diffseq.h b/lib/diffseq.h index d7a374357c7..a3cf140990b 100644 --- a/lib/diffseq.h +++ b/lib/diffseq.h | |||
| @@ -279,6 +279,11 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, | |||
| 279 | continue; | 279 | continue; |
| 280 | 280 | ||
| 281 | #ifdef USE_HEURISTIC | 281 | #ifdef USE_HEURISTIC |
| 282 | bool heuristic = ctxt->heuristic; | ||
| 283 | #else | ||
| 284 | bool heuristic = false; | ||
| 285 | #endif | ||
| 286 | |||
| 282 | /* Heuristic: check occasionally for a diagonal that has made lots | 287 | /* Heuristic: check occasionally for a diagonal that has made lots |
| 283 | of progress compared with the edit distance. If we have any | 288 | of progress compared with the edit distance. If we have any |
| 284 | such, find the one that has made the most progress and return it | 289 | such, find the one that has made the most progress and return it |
| @@ -287,7 +292,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, | |||
| 287 | With this heuristic, for vectors with a constant small density | 292 | With this heuristic, for vectors with a constant small density |
| 288 | of changes, the algorithm is linear in the vector size. */ | 293 | of changes, the algorithm is linear in the vector size. */ |
| 289 | 294 | ||
| 290 | if (200 < c && big_snake && ctxt->heuristic) | 295 | if (200 < c && big_snake && heuristic) |
| 291 | { | 296 | { |
| 292 | { | 297 | { |
| 293 | OFFSET best = 0; | 298 | OFFSET best = 0; |
| @@ -367,7 +372,6 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal, | |||
| 367 | } | 372 | } |
| 368 | } | 373 | } |
| 369 | } | 374 | } |
| 370 | #endif /* USE_HEURISTIC */ | ||
| 371 | 375 | ||
| 372 | /* Heuristic: if we've gone well beyond the call of duty, give up | 376 | /* Heuristic: if we've gone well beyond the call of duty, give up |
| 373 | and report halfway between our best results so far. */ | 377 | and report halfway between our best results so far. */ |