From: Arnaud Giersch Date: Mon, 5 Jul 2021 13:17:29 +0000 (+0200) Subject: Use reference to const for large input parameters. X-Git-Tag: v3.28~39 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/83f030eeb0e339f9dd779251fb507756faaeb2e8 Use reference to const for large input parameters. --- diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index b7232c13d7..945f56127f 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -35,7 +35,7 @@ public: unsigned int get_id_by_name(const char* name) const { return name2id.at(name); } void add_child(Container* child); - void add_resources(std::vector hosts); + void add_resources(const std::vector& hosts); void create_hierarchy(const_sg_netzone_t from_as); std::vector get_hierarchy(); std::string get_hierarchy_as_string(); diff --git a/src/instr/jedule/jedule_platform.cpp b/src/instr/jedule/jedule_platform.cpp index 05a7b40922..00f78dad26 100644 --- a/src/instr/jedule/jedule_platform.cpp +++ b/src/instr/jedule/jedule_platform.cpp @@ -36,7 +36,7 @@ void Container::add_child(jed_container_t child) child->set_parent(this); } -void Container::add_resources(std::vector hosts) +void Container::add_resources(const std::vector& hosts) { children_.clear(); last_id_ = 0; @@ -144,7 +144,7 @@ void Container::print(FILE* jed_file) } // namespace jedule } // namespace simgrid -static void add_subsets_to(std::vector& subset_list, std::vector hostgroup, +static void add_subsets_to(std::vector& subset_list, const std::vector& hostgroup, jed_container_t parent) { // get ids for each host