Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Whenever possible, use std::move() for parameters (mostly std::string).
[simgrid.git] / src / s4u / s4u_Exec.cpp
index 047c786..0ecdc72 100644 (file)
@@ -117,14 +117,14 @@ ExecPtr Exec::set_host(Host* host)
 ExecPtr Exec::set_name(std::string name)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the name of an exec after its start");
-  name_ = name;
+  name_ = std::move(name);
   return this;
 }
 
 ExecPtr Exec::set_tracing_category(std::string category)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the tracing category of an exec after its start");
-  tracing_category_ = category;
+  tracing_category_ = std::move(category);
   return this;
 }