We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecf4854 commit 0e91979Copy full SHA for 0e91979
cpr/threadpool.cpp
@@ -11,7 +11,8 @@
11
#include <utility>
12
13
namespace cpr {
14
-size_t ThreadPool::DEFAULT_MAX_THREAD_COUNT = std::thread::hardware_concurrency();
+// NOLINTNEXTLINE(cert-err58-cpp) Not relevant since trivial function.
15
+size_t ThreadPool::DEFAULT_MAX_THREAD_COUNT = std::max<size_t>(std::thread::hardware_concurrency(), static_cast<size_t>(1));
16
17
ThreadPool::ThreadPool(size_t minThreadCount, size_t maxThreadCount) : minThreadCount(minThreadCount), maxThreadCount(maxThreadCount) {
18
assert(minThreadCount <= maxThreadCount);
0 commit comments