From ea48c7ab11c97b876fd016e72f71dbef2c718ed6 Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 22 Jan 2015 14:32:53 +0300 Subject: [PATCH] Fix issue#10: removed unnecessary null pointer checks --- src/dhp_gc.cpp | 6 ++---- tests/cppunit/thread.cpp | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/dhp_gc.cpp b/src/dhp_gc.cpp index 375fb8b7..ea41aa14 100644 --- a/src/dhp_gc.cpp +++ b/src/dhp_gc.cpp @@ -147,10 +147,8 @@ namespace cds { namespace gc { namespace dhp { void CDS_STDCALL GarbageCollector::Destruct() { - if ( m_pManager ) { - delete m_pManager; - m_pManager = nullptr; - } + delete m_pManager; + m_pManager = nullptr; } GarbageCollector::GarbageCollector( size_t nLiberateThreshold, size_t nInitialThreadGuardCount ) diff --git a/tests/cppunit/thread.cpp b/tests/cppunit/thread.cpp index af15fa93..a50aa370 100644 --- a/tests/cppunit/thread.cpp +++ b/tests/cppunit/thread.cpp @@ -42,10 +42,8 @@ namespace CppUnitMini { ThreadPool::~ThreadPool() { - if ( m_pBarrierStart ) - delete m_pBarrierStart; - if ( m_pBarrierDone ) - delete m_pBarrierDone; + delete m_pBarrierStart; + delete m_pBarrierDone; for ( size_t i = 0; i < m_arrThreads.size(); ++i ) delete m_arrThreads[i]; -- 2.34.1