diff options
author | Jason Evans <jasone@canonware.com> | 2013-11-30 00:19:44 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2013-11-30 00:19:44 (GMT) |
commit | addad093f887cecddd462b7130125a0e08060e1f (patch) | |
tree | 434671c245c4c37e586a5ae6bbdbe2ff516e508e /src/jemalloc.c | |
parent | 39e7fd0580a140912fa1170de7a7699c86afe45d (diff) | |
download | jemalloc-addad093f887cecddd462b7130125a0e08060e1f.zip jemalloc-addad093f887cecddd462b7130125a0e08060e1f.tar.gz jemalloc-addad093f887cecddd462b7130125a0e08060e1f.tar.bz2 |
Clean up malloc_ncpus().
Clean up malloc_ncpus() by replacing incorrectly indented if..else
branches with a ?: expression.
Submitted by Igor Podlesny.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r-- | src/jemalloc.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index 491ec32..d1521ea 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 |