Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use structured binding declarations (sonar, c++17).
[simgrid.git] / src / surf / sg_platf.cpp
index a149825..f885a28 100644 (file)
@@ -249,8 +249,8 @@ static void sg_platf_new_cluster_flat(simgrid::kernel::routing::ClusterCreationA
     zone->set_parent(parent);
 
   /* set properties */
-  for (auto const& elm : cluster->properties)
-    zone->set_property(elm.first, elm.second);
+  for (auto const& [key, value] : cluster->properties)
+    zone->set_property(key, value);
 
   /* Make the backbone */
   const simgrid::s4u::Link* backbone = nullptr;
@@ -591,7 +591,7 @@ void sg_platf_new_hostlink(const simgrid::kernel::routing::HostLinkCreationArgs*
   zone_cluster.host_links.emplace_back(*hostlink);
 }
 
-void sg_platf_new_trace(simgrid::kernel::routing::ProfileCreationArgs* args)
+void sg_platf_new_trace(const simgrid::kernel::routing::ProfileCreationArgs* args)
 {
   simgrid::kernel::profile::Profile* profile;
   if (not args->file.empty()) {
@@ -601,5 +601,5 @@ void sg_platf_new_trace(simgrid::kernel::routing::ProfileCreationArgs* args)
                args->id.c_str());
     profile = simgrid::kernel::profile::ProfileBuilder::from_string(args->id, args->pc_data, args->periodicity);
   }
-  traces_set_list.insert({args->id, profile});
+  traces_set_list.try_emplace(args->id, profile);
 }