From: Arnaud Giersch Date: Wed, 13 Feb 2019 10:07:40 +0000 (+0100) Subject: Polish passage of std::string parameters. X-Git-Tag: v3_22~332 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ccfb980e299d6cefe0dc683facfe33232336c5da?hp=cb346689abc948bdaff8666ce48d4eb6014dadea Polish passage of std::string parameters. --- diff --git a/examples/s4u/replay-storage/s4u-replay-storage.cpp b/examples/s4u/replay-storage/s4u-replay-storage.cpp index 2f85ad6ebd..a20bd42af4 100644 --- a/examples/s4u/replay-storage/s4u-replay-storage.cpp +++ b/examples/s4u/replay-storage/s4u-replay-storage.cpp @@ -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; diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index a6f8e68eaa..17bff97aa0 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -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) diff --git a/src/instr/instr_paje_containers.hpp b/src/instr/instr_paje_containers.hpp index a5ca5f59f6..3e27997aa5 100644 --- a/src/instr/instr_paje_containers.hpp +++ b/src/instr/instr_paje_containers.hpp @@ -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(); }; diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp index 2590273400..3b1da03f7c 100644 --- a/src/instr/instr_paje_events.hpp +++ b/src/instr/instr_paje_events.hpp @@ -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) { }