Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Polish passage of std::string parameters.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 10:07:40 +0000 (11:07 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 16:51:16 +0000 (17:51 +0100)
examples/s4u/replay-storage/s4u-replay-storage.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_containers.hpp
src/instr/instr_paje_events.hpp

index 2f85ad6..a20bd42 100644 (file)
@@ -29,7 +29,7 @@ static void log_action(simgrid::xbt::ReplayAction& action, double date)
   }
 }
 
-static simgrid::s4u::File* get_file_descriptor(std::string file_name)
+static simgrid::s4u::File* get_file_descriptor(const std::string& file_name)
 {
   std::string full_name = simgrid::s4u::this_actor::get_name() + ":" + file_name;
 
index a6f8e68..17bff97 100644 (file)
@@ -70,7 +70,7 @@ HostContainer::HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father)
   trivaNodeTypes.insert(type_->get_name());
 }
 
-Container::Container(std::string name, std::string type_name, Container* father)
+Container::Container(std::string name, const std::string& type_name, Container* father)
     : name_(std::move(name)), father_(father)
 {
   static long long int container_id = 0;
@@ -117,9 +117,9 @@ Container::~Container()
   allContainers.erase(name_);
 }
 
-void Container::create_child(std::string name, std::string type_name)
+void Container::create_child(std::string name, const std::string& type_name)
 {
-  new Container(std::move(name), std::move(type_name), this);
+  new Container(std::move(name), type_name, this);
 }
 
 Container* Container::by_name_or_null(const std::string& name)
index a5ca5f5..3e27997 100644 (file)
@@ -20,7 +20,7 @@ class Container {
   long long int id_;
   std::string name_; /* Unique name of this container */
 public:
-  Container(std::string name, std::string type_name, Container* father);
+  Container(std::string name, const std::string& type_name, Container* father);
   virtual ~Container();
 
   Type* type_; /* Type of this container */
@@ -40,7 +40,7 @@ public:
   StateType* get_state(const std::string& name);
   LinkType* get_link(const std::string& name);
   VariableType* get_variable(const std::string& name);
-  void create_child(std::string name, std::string type_name);
+  void create_child(std::string name, const std::string& type_name);
   static Container* get_root();
 };
 
index 2590273..3b1da03 100644 (file)
@@ -89,7 +89,7 @@ public:
       : PajeEvent(container, type, SIMIX_get_clock(), event_type)
       , endpoint_(sourceContainer)
       , value_(std::move(value))
-      , key_(key)
+      , key_(std::move(key))
       , size_(size)
   {
   }