Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use XBT_DECLARE_ENUM_CLASS for s4u::Activity::State.
[simgrid.git] / src / s4u / s4u_Semaphore.cpp
index a30ea0ab4a7472dbb67d2c3a8beba723e0bbb519..d16abce10cde60a85dfc401d1efa02d46a197aab 100644 (file)
@@ -17,10 +17,8 @@ Semaphore::Semaphore(unsigned int initial_capacity) : pimpl_(new kernel::activit
 
 Semaphore::~Semaphore()
 {
-  if (pimpl_ != nullptr) {
-    xbt_assert(not pimpl_->is_used(), "Cannot destroy semaphore since someone is still using it");
-    delete pimpl_;
-  }
+  xbt_assert(not pimpl_->is_used(), "Cannot destroy semaphore since someone is still using it");
+  delete pimpl_;
 }
 
 SemaphorePtr Semaphore::create(unsigned int initial_capacity)