From addad093f887cecddd462b7130125a0e08060e1f Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 29 Nov 2013 16:19:44 -0800 Subject: [PATCH] Clean up malloc_ncpus(). Clean up malloc_ncpus() by replacing incorrectly indented if..else branches with a ?: expression. Submitted by Igor Podlesny. --- src/jemalloc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index 491ec324..d1521eaf 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -262,14 +262,7 @@ malloc_ncpus(void) #else result = sysconf(_SC_NPROCESSORS_ONLN); #endif - if (result == -1) { - /* Error. */ - ret = 1; - } else { - ret = (unsigned)result; - } - - return (ret); + return ((result == -1) ? 1 : (unsigned)result); } void