Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dynamic cast without checking result is slow and useless. Use static cast.
[simgrid.git] / src / simix / ActorImpl.cpp
index 2a5262f149b610781760de68d74909bc27a9046c..4fc435d496821f88fb673b790a2740c430362380 100644 (file)
@@ -148,7 +148,7 @@ void ActorImpl::exit()
       io->cancel();
     } else {
       simgrid::kernel::activity::ActivityImplPtr activity = waiting_synchro;
-      xbt_die("Activity %s is of unknown type %s", activity->name_.c_str(),
+      xbt_die("Activity %s is of unknown type %s", activity->get_cname(),
               simgrid::xbt::demangle(typeid(activity).name()).get());
     }
 
@@ -295,7 +295,7 @@ smx_activity_t ActorImpl::sleep(double duration)
 {
   if (not host_->is_on())
     throw_exception(std::make_exception_ptr(simgrid::HostFailureException(
-        XBT_THROW_POINT, std::string("Host ") + std::string(host_->get_cname()) + " failed, you cannot sleep there.")));
+        XBT_THROW_POINT, std::string("Host ") + host_->get_cname() + " failed, you cannot sleep there.")));
 
   return simgrid::kernel::activity::SleepImplPtr(new simgrid::kernel::activity::SleepImpl("sleep", host_))
       ->start(duration);
@@ -631,7 +631,7 @@ void SIMIX_process_sleep_destroy(smx_activity_t synchro)
 {
   XBT_DEBUG("Destroy sleep synchro %p", synchro.get());
   simgrid::kernel::activity::SleepImplPtr sleep =
-      boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(synchro);
+      boost::static_pointer_cast<simgrid::kernel::activity::SleepImpl>(synchro);
 
   if (sleep->surf_action_) {
     sleep->surf_action_->unref();