From a43a79e4dd01f75d80fa2262741c641212c5ceaa Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 14 Dec 2020 09:15:59 +0100 Subject: Simplify boolean expressions * ACE/ace/Event_Handler.cpp: * ACE/ace/Recursive_Thread_Mutex.cpp: * ACE/ace/Thread_Manager.cpp: --- ACE/ace/Event_Handler.cpp | 6 +++--- ACE/ace/Recursive_Thread_Mutex.cpp | 2 +- ACE/ace/Thread_Manager.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ACE/ace/Event_Handler.cpp b/ACE/ace/Event_Handler.cpp index 0a2bb21f52b..4b016b0b1bc 100644 --- a/ACE/ace/Event_Handler.cpp +++ b/ACE/ace/Event_Handler.cpp @@ -354,19 +354,19 @@ ACE_Event_Handler_var::reset (ACE_Event_Handler *p) ACE_Event_Handler_var::operator bool() const { - return this->ptr_ == nullptr ? false : true; + return this->ptr_ != nullptr; } bool ACE_Event_Handler_var::operator ==(std::nullptr_t) const { - return this->ptr_ == nullptr ? true : false; + return this->ptr_ == nullptr; } bool ACE_Event_Handler_var::operator !=(std::nullptr_t) const { - return this->ptr_ == nullptr ? false : true; + return this->ptr_ != nullptr; } diff --git a/ACE/ace/Recursive_Thread_Mutex.cpp b/ACE/ace/Recursive_Thread_Mutex.cpp index 9642f40f505..047a334a24b 100644 --- a/ACE/ace/Recursive_Thread_Mutex.cpp +++ b/ACE/ace/Recursive_Thread_Mutex.cpp @@ -47,7 +47,7 @@ ACE_Recursive_Thread_Mutex::remove () { // ACE_TRACE ("ACE_Recursive_Thread_Mutex::remove"); int result = 0; - if (this->removed_ == false) + if (!this->removed_) { this->removed_ = true; result = ACE_OS::recursive_mutex_destroy (&this->lock_); diff --git a/ACE/ace/Thread_Manager.cpp b/ACE/ace/Thread_Manager.cpp index e5434960e02..4b7042c1216 100644 --- a/ACE/ace/Thread_Manager.cpp +++ b/ACE/ace/Thread_Manager.cpp @@ -1717,7 +1717,7 @@ ACE_Thread_Manager::wait (const ACE_Time_Value *timeout, ACE_Auto_Ptr local_timeout; // Check to see if we're using absolute time or not. - if (use_absolute_time == false && timeout != 0) + if (!use_absolute_time && timeout != 0) { // create time value duplicate (preserves time policy) local_timeout.reset (timeout->duplicate ()); -- cgit v1.2.1