From 689ef502f5b0655c9923ed77da2ae3504630f473 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 22:27:37 +0100 Subject: refactor(3p/nix): Apply clang-tidy's readability-* fixes This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html --- third_party/nix/src/libutil/thread-pool.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'third_party/nix/src/libutil/thread-pool.cc') diff --git a/third_party/nix/src/libutil/thread-pool.cc b/third_party/nix/src/libutil/thread-pool.cc index d0042c6df195..879de446c294 100644 --- a/third_party/nix/src/libutil/thread-pool.cc +++ b/third_party/nix/src/libutil/thread-pool.cc @@ -8,9 +8,9 @@ namespace nix { ThreadPool::ThreadPool(size_t _maxThreads) : maxThreads(_maxThreads) { restoreAffinity(); // FIXME - if (!maxThreads) { + if (maxThreads == 0u) { maxThreads = std::thread::hardware_concurrency(); - if (!maxThreads) { + if (maxThreads == 0u) { maxThreads = 1; } } @@ -111,8 +111,8 @@ void ThreadPool::doWork(bool mainThread) { try { std::rethrow_exception(exc); } catch (std::exception& e) { - if (!dynamic_cast(&e) && - !dynamic_cast(&e)) { + if ((dynamic_cast(&e) == nullptr) && + (dynamic_cast(&e) == nullptr)) { ignoreException(); } } catch (...) { @@ -135,7 +135,7 @@ void ThreadPool::doWork(bool mainThread) { /* If there are no active or pending items, and the main thread is running process(), then no new items can be added. So exit. */ - if (!state->active && state->draining) { + if ((state->active == 0u) && state->draining) { quit = true; work.notify_all(); return; -- cgit 1.4.1