]> mj.ucw.cz Git - libucw.git/commitdiff
actually, the number of runs is halved during each pass, so take it into
authorRobert Spalek <robert@ucw.cz>
Tue, 9 Nov 2004 15:39:39 +0000 (15:39 +0000)
committerRobert Spalek <robert@ucw.cz>
Tue, 9 Nov 2004 15:39:39 +0000 (15:39 +0000)
account in the stopping condition

lib/sorter.h

index b3110c5ae026769aab2688f2cb42a92a423ef2e9..4c7f19904be4f21944044c1a16b26adc4112ea3c 100644 (file)
@@ -539,7 +539,7 @@ struct fastbuf *fb1, struct fastbuf *fb2
       if (SORT_UP_TO)
        max_run_count /= SORT_UP_TO;
       do
-       run_count = P(pass)(&fb1, &fb2, run_count < max_run_count);
+       run_count = P(pass)(&fb1, &fb2, (run_count+1)/2 <= max_run_count);
       while (fb1 && fb2);
     }
 #endif