From: Robert Spalek Date: Tue, 9 Nov 2004 15:39:39 +0000 (+0000) Subject: actually, the number of runs is halved during each pass, so take it into X-Git-Tag: holmes-import~875 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7e4c6c5e84aa5238d6223bc39b8c8b3d875385aa;p=libucw.git actually, the number of runs is halved during each pass, so take it into account in the stopping condition --- 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