Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Whenever possible, use std::move() for parameters (mostly std::string).
[simgrid.git] / src / kernel / routing / NetZoneImpl.cpp
index bdc9a7e..f61f9df 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-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. */
@@ -27,13 +27,13 @@ public:
 };
 
 NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model)
-    : network_model_(network_model), piface_(this), father_(father), name_(name)
+    : network_model_(network_model), piface_(this), father_(father), name_(std::move(name))
 {
-  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name.c_str()),
-             "Refusing to create a second NetZone called '%s'.", name.c_str());
+  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name_.c_str()),
+             "Refusing to create a second NetZone called '%s'.", name_.c_str());
 
-  netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, father);
-  XBT_DEBUG("NetZone '%s' created with the id '%u'", name.c_str(), netpoint_->id());
+  netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father);
+  XBT_DEBUG("NetZone '%s' created with the id '%u'", name_.c_str(), netpoint_->id());
 }
 
 NetZoneImpl::~NetZoneImpl()
@@ -126,7 +126,7 @@ void NetZoneImpl::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing:
 }
 
 void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                                   std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+                                   std::vector<resource::LinkImpl*>& link_list, bool /* symmetrical */)
 {
   /* Argument validity checks */
   if (gw_dst) {