From 2a464e01fa4c8b922af395aad24275912d3228a7 Mon Sep 17 00:00:00 2001 From: moe li Date: Sun, 14 Sep 2025 23:39:08 +0800 Subject: [PATCH] style changes. use suggested style for libuv. Co-authored-by: Ben Noordhuis --- src/threadpool.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/threadpool.c b/src/threadpool.c index ef98a973a..2a129a5d4 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -194,24 +194,20 @@ void uv__threadpool_cleanup(void) { static void init_threads(void) { uv_thread_options_t config; unsigned int i; - - size_t bufsize; - char fastvarbuf[16]; + size_t buflen; + char buf[16]; const char* val; - int err; uv_sem_t sem; nthreads = ARRAY_SIZE(default_threads); - bufsize = ARRAY_SIZE(fastvarbuf); - - err = uv_os_getenv("UV_THREADPOOL_SIZE", fastvarbuf, &bufsize); + buflen = ARRAY_SIZE(buf); + err = uv_os_getenv("UV_THREADPOOL_SIZE", buf, &buflen); + val = NULL; if (err == 0) - val = fastvarbuf; - else - val = NULL; /* UV_ENOBUFS, UV_ENOENT and other err */ + val = buf; if (val != NULL) nthreads = atoi(val);