Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No need to test 'not detached_' twice in the same test
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Feb 2021 12:56:39 +0000 (13:56 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 6 Feb 2021 12:56:39 +0000 (13:56 +0100)
src/kernel/activity/CommImpl.cpp
src/s4u/s4u_Comm.cpp

index 630a2c2..d056c3b 100644 (file)
@@ -408,7 +408,7 @@ CommImpl::CommImpl(s4u::Host* from, s4u::Host* to, double bytes)
 
 CommImpl::~CommImpl()
 {
-  XBT_DEBUG("Really free communication %p in state %d (detached = %d)", this, static_cast<int>(state_), detached_);
+  XBT_DEBUG("Really free communication %p in state %s (detached = %d)", this, get_state_str(), detached_);
 
   cleanup_surf();
 
index edec580..26fffb7 100644 (file)
@@ -23,11 +23,7 @@ Comm::~Comm()
 {
   if (state_ == State::STARTED && not detached_ &&
       (pimpl_ == nullptr || pimpl_->state_ == kernel::activity::State::RUNNING)) {
-    if (not detached_)
-      XBT_INFO("Comm %p freed before its completion. Did you forget to detach it? (state: %s)", this, get_state_str());
-    else
-      XBT_INFO("Detached comm %p freed before its completion, please report that bug along with a MWE (state: %s).",
-               this, get_state_str());
+    XBT_INFO("Comm %p freed before its completion. Did you forget to detach it? (state: %s)", this, get_state_str());
     if (pimpl_ != nullptr)
       XBT_INFO("pimpl_->state: %s", pimpl_->get_state_str());
     else