* src/sort.c: Avoid some silly merges.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Nov 2004 23:47:13 +0000 (23:47 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Nov 2004 23:47:13 +0000 (23:47 +0000)
ChangeLog

index 7c5f30d..d064b64 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,23 @@
-2004-11-06  Jim Meyering  <jim@meyering.net>
+2004-11-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        * Version 5.3.0.
 
+       * src/sort.c (first_same_file): Remove.  Move most of the code to....
+       (avoid_trashing_input): New function.
+       (merge): Avoid some silly merges, e.g., copying a single file to
+       a temporary file when there are exactly 17 input files to merge.
+       Take a count of temporary files rather than a max_merge arg.
+       All uses changed.
+
+2004-11-06  Jim Meyering  <jim@meyering.net>
+
        * src/sort.c (xfclose): Don't close stdout here (just flush it),
        since close_stdout now closes stdout unconditionally.
 
 2004-11-05  Paul Eggert  <eggert@cs.ucla.edu>
 
        * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
-       first_same_file, merge, sort, main): Use size_t for indexes into arrays.
+       first_same_file, merge, sort, main): Use size_t for indexes to arrays.
        This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
        temporary files).
        (getmonth, keycompare, compare): Rewrite to avoid need for alloca,