Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some const qualifier, needed for later changes.
[simgrid.git] / src / kernel / routing / DragonflyZone.cpp
index 34b4513..68235e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -18,7 +18,7 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-DragonflyZone::DragonflyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
+DragonflyZone::DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
     : ClusterZone(father, name, netmodel)
 {
 }
@@ -169,9 +169,9 @@ void DragonflyZone::create_link(const std::string& id, int numlinks, resource::L
   linkTemplate.bandwidth = this->bw_ * numlinks;
   linkTemplate.latency   = this->lat_;
   linkTemplate.policy    = this->sharing_policy_;
-  linkTemplate.id        = id;
+  linkTemplate.id        = std::move(id);
   sg_platf_new_link(&linkTemplate);
-  XBT_DEBUG("Generating link %s", id.c_str());
+  XBT_DEBUG("Generating link %s", linkTemplate.id.c_str());
   resource::LinkImpl* link;
   if (this->sharing_policy_ == s4u::Link::SharingPolicy::SPLITDUPLEX) {
     *linkup   = s4u::Link::by_name(linkTemplate.id + "_UP")->get_impl();   // check link?