summaryrefslogtreecommitdiff
path: root/lib/diffseq.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-06-17 15:12:50 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-06-17 15:13:21 -0700
commit209ddb1092940c65c4c684fa6d0d8c4e3c6e6bdd (patch)
tree09280010c8531a0cda6f7b30e8b82807a712ed8f /lib/diffseq.h
parent4caa8d4de4cc9c84b2d49a75f24c1626aa3c3f73 (diff)
downloademacs-209ddb1092940c65c4c684fa6d0d8c4e3c6e6bdd.tar.gz
Merge from gnulib
This (and my previous patch) incorporate: 2017-06-17 diffseq: port to GCC 7 with --enable-gcc-warnings 2017-06-15 gettext-h: Update comment * lib/diffseq.h: Copy from gnulib.
Diffstat (limited to 'lib/diffseq.h')
-rw-r--r--lib/diffseq.h8
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,
continue;
#ifdef USE_HEURISTIC
+ bool heuristic = ctxt->heuristic;
+#else
+ bool heuristic = false;
+#endif
+
/* Heuristic: check occasionally for a diagonal that has made lots
of progress compared with the edit distance. If we have any
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,
With this heuristic, for vectors with a constant small density
of changes, the algorithm is linear in the vector size. */
- if (200 < c && big_snake && ctxt->heuristic)
+ if (200 < c && big_snake && heuristic)
{
{
OFFSET best = 0;
@@ -367,7 +372,6 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
}
}
}
-#endif /* USE_HEURISTIC */
/* Heuristic: if we've gone well beyond the call of duty, give up
and report halfway between our best results so far. */