From: Paul Eggert Date: Thu, 23 Dec 2010 07:29:57 +0000 (-0800) Subject: sort: minor performance tweak with num_processors X-Git-Tag: v8.9~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d0a1203777bf8478822e6dfb64cd49368a4d588;p=thirdparty%2Fcoreutils.git sort: minor performance tweak with num_processors * src/sort.c (main): Don't invoke num_processors twice. --- diff --git a/src/sort.c b/src/sort.c index f193e04a08..96e06960d2 100644 --- a/src/sort.c +++ b/src/sort.c @@ -4601,8 +4601,8 @@ main (int argc, char **argv) { if (!nthreads) { - nthreads = MIN (DEFAULT_MAX_THREADS, - num_processors (NPROC_CURRENT_OVERRIDABLE)); + unsigned long int np = num_processors (NPROC_CURRENT_OVERRIDABLE); + nthreads = MIN (np, DEFAULT_MAX_THREADS); } /* Avoid integer overflow later. */