diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-22 23:29:57 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-22 23:30:35 -0800 |
commit | 1d0a1203777bf8478822e6dfb64cd49368a4d588 (patch) | |
tree | 7e05f1b0d30a1c02f8ce9d0b4359fd12b990da3f /src/sort.c | |
parent | 83e01384804810e14a9d2765760c670b9b6a7dd8 (diff) | |
download | coreutils-1d0a1203777bf8478822e6dfb64cd49368a4d588.tar.xz |
sort: minor performance tweak with num_processors
* src/sort.c (main): Don't invoke num_processors twice.
Diffstat (limited to 'src/sort.c')
-rw-r--r-- | src/sort.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sort.c b/src/sort.c index f193e04a0..96e06960d 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. */ |