Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove explicit conversion to std::string when it's not required.
[simgrid.git] / src / kernel / actor / ActorImpl.cpp
index 6def798..be71dd3 100644 (file)
@@ -66,7 +66,7 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
     throw HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.");
   }
 
-  auto* actor = new ActorImpl(std::string(name), host, /*ppid*/ -1);
+  auto* actor = new ActorImpl(name, host, /*ppid*/ -1);
   /* Actor data */
   actor->piface_.set_data(data);
   actor->code_ = nullptr;
@@ -371,8 +371,8 @@ activity::ActivityImplPtr ActorImpl::join(const ActorImpl* actor, double timeout
 activity::ActivityImplPtr ActorImpl::sleep(double duration)
 {
   if (not host_->is_on())
-    throw_exception(std::make_exception_ptr(HostFailureException(
-        XBT_THROW_POINT, std::string("Host ") + host_->get_cname() + " failed, you cannot sleep there.")));
+    throw_exception(std::make_exception_ptr(
+        HostFailureException(XBT_THROW_POINT, "Host " + host_->get_name() + " failed, you cannot sleep there.")));
 
   auto sleep_activity = new activity::SleepImpl();
   sleep_activity->set_name("sleep").set_host(host_).set_duration(duration).start();