diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-02-23 16:16:31 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-02-23 16:17:09 -0800 |
commit | 67b00f9a6c5cc08c9c667822b21e18a59b318dd5 (patch) | |
tree | e0d4027da59f3e7b4e7ffc363a5f8cb6af2ee969 /lib/git-merge-changelog.c | |
parent | 26e2108a3b6bad235316f36d68365f5a9ee9f634 (diff) | |
download | gnulib-67b00f9a6c5cc08c9c667822b21e18a59b318dd5.tar.gz |
diffseq: remove TOO_EXPENSIVE heuristic
Problem with diffutils reported by Vincent Lefevre in
<http://bugs.gnu.org/16848>. The simplest solution is to remove
the TOO_EXPENSIVE heuristic that I added to GNU diff in 1993.
Although appropriate for circa-1993 hardware, these days the heuristic
seems to be more trouble than it's worth.
* lib/diffseq.h: Modernize citations.
(struct context): Remove member too_expensive.
All uses changed.
(struct partition): Remove members lo_minimal, hi_minimal.
All uses changed.
(diag, compareseq): Remove arg find_minimal. All uses changed.
(diag): Remove the TOO_EXPENSIVE heuristic that I added back in
1993 to make 'diff' run faster (but not as well) on large inputs.
These days, computers are fast enough that it's typically better
to run slower but more accurately.
* lib/fstrcmp.c: Remove duplicate comment.
* lib/fstrcmp.c (strcmp_bounded):
* lib/git-merge-changelog.c (compute_differences):
Adjust to diffseq.h changes.
Diffstat (limited to 'lib/git-merge-changelog.c')
-rw-r--r-- | lib/git-merge-changelog.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/git-merge-changelog.c b/lib/git-merge-changelog.c index 60dd97245a..9d4bd5c809 100644 --- a/lib/git-merge-changelog.c +++ b/lib/git-merge-changelog.c @@ -678,11 +678,10 @@ compute_differences (struct changelog_file *file1, struct changelog_file *file2, ctxt.index_mapping_reverse[j] = 0; ctxt.fdiag = XNMALLOC (2 * (n1 + n2 + 3), ssize_t) + n2 + 1; ctxt.bdiag = ctxt.fdiag + n1 + n2 + 3; - ctxt.too_expensive = n1 + n2; /* Store in ctxt.index_mapping and ctxt.index_mapping_reverse a -1 for each removed or added entry. */ - compareseq (0, n1, 0, n2, 0, &ctxt); + compareseq (0, n1, 0, n2, &ctxt); /* Complete the index_mapping and index_mapping_reverse arrays. */ i = 0; |