From 7e4c6c5e84aa5238d6223bc39b8c8b3d875385aa Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Tue, 9 Nov 2004 15:39:39 +0000 Subject: [PATCH] actually, the number of runs is halved during each pass, so take it into account in the stopping condition --- lib/sorter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sorter.h b/lib/sorter.h index b3110c5a..4c7f1990 100644 --- a/lib/sorter.h +++ b/lib/sorter.h @@ -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 -- 2.39.2