Commit b0b6a792 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Prefer bool literals rather than integers in boolean contexts

Summary: Via clang-tidy's modernize-use-bool-literals

Reviewed By: yfeldblum

Differential Revision: D6130384

fbshipit-source-id: 359d5195897f04612c9b9042cf69383050a2ec7a
parent f2925b23
...@@ -113,7 +113,7 @@ void CPUThreadPoolExecutor::threadRun(std::shared_ptr<Thread> thread) { ...@@ -113,7 +113,7 @@ void CPUThreadPoolExecutor::threadRun(std::shared_ptr<Thread> thread) {
this->threadPoolHook_.registerThread(); this->threadPoolHook_.registerThread();
thread->startupBaton.post(); thread->startupBaton.post();
while (1) { while (true) {
auto task = taskQueue_->take(); auto task = taskQueue_->take();
if (UNLIKELY(task.poison)) { if (UNLIKELY(task.poison)) {
CHECK(threadsToStop_-- > 0); CHECK(threadsToStop_-- > 0);
......
...@@ -214,7 +214,7 @@ void ThreadPoolExecutor::StoppedThreadQueue::add( ...@@ -214,7 +214,7 @@ void ThreadPoolExecutor::StoppedThreadQueue::add(
} }
ThreadPoolExecutor::ThreadPtr ThreadPoolExecutor::StoppedThreadQueue::take() { ThreadPoolExecutor::ThreadPtr ThreadPoolExecutor::StoppedThreadQueue::take() {
while (1) { while (true) {
{ {
std::lock_guard<std::mutex> guard(mutex_); std::lock_guard<std::mutex> guard(mutex_);
if (queue_.size() > 0) { if (queue_.size() > 0) {
......
...@@ -965,14 +965,14 @@ bool AsyncSSLSocket::willBlock(int ret, ...@@ -965,14 +965,14 @@ bool AsyncSSLSocket::willBlock(int ret,
// The timeout (if set) keeps running here // The timeout (if set) keeps running here
return true; return true;
#endif #endif
} else if ((0 } else if ((false
#ifdef SSL_ERROR_WANT_RSA_ASYNC_PENDING #ifdef SSL_ERROR_WANT_RSA_ASYNC_PENDING
|| error == SSL_ERROR_WANT_RSA_ASYNC_PENDING || error == SSL_ERROR_WANT_RSA_ASYNC_PENDING
#endif #endif
#ifdef SSL_ERROR_WANT_ECDSA_ASYNC_PENDING #ifdef SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
|| error == SSL_ERROR_WANT_ECDSA_ASYNC_PENDING || error == SSL_ERROR_WANT_ECDSA_ASYNC_PENDING
#endif #endif
)) { )) {
// Our custom openssl function has kicked off an async request to do // Our custom openssl function has kicked off an async request to do
// rsa/ecdsa private key operation. When that call returns, a callback will // rsa/ecdsa private key operation. When that call returns, a callback will
// be invoked that will re-call handleAccept. // be invoked that will re-call handleAccept.
......
...@@ -446,7 +446,7 @@ class ConcurrentAccessData { ...@@ -446,7 +446,7 @@ class ConcurrentAccessData {
} else { } else {
skipListInsert(0, writeValues_[t]); skipListInsert(0, writeValues_[t]);
} }
return 0; return false;
default: default:
return skipListFind(0, readValues_[t]); return skipListFind(0, readValues_[t]);
} }
...@@ -465,7 +465,7 @@ class ConcurrentAccessData { ...@@ -465,7 +465,7 @@ class ConcurrentAccessData {
} else { } else {
setInsert(idx, writeValues_[t]); setInsert(idx, writeValues_[t]);
} }
return 0; return false;
default: default:
return setFind(idx, readValues_[t]); return setFind(idx, readValues_[t]);
} }
......
...@@ -1018,7 +1018,7 @@ TEST(FBString, testAllClauses) { ...@@ -1018,7 +1018,7 @@ TEST(FBString, testAllClauses) {
void(*f_fbstring)(folly::fbstring&), void(*f_fbstring)(folly::fbstring&),
void(*f_wfbstring)(folly::basic_fbstring<wchar_t>&)) { void(*f_wfbstring)(folly::basic_fbstring<wchar_t>&)) {
do { do {
if (1) { if (true) {
} else { } else {
EXPECT_TRUE(1) << "Testing clause " << clause; EXPECT_TRUE(1) << "Testing clause " << clause;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment