Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Rename shadowing local variables.
[simgrid.git] / src / surf / sg_platf.cpp
index bbea348..83178f8 100644 (file)
@@ -86,7 +86,7 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
     host->pimpl_cpu->set_speed_profile(args->speed_trace);
   if (args->pstate != 0)
     host->pimpl_cpu->set_pstate(args->pstate);
-  if (args->coord && strcmp(args->coord, ""))
+  if (not args->coord.empty())
     new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord);
 }
 
@@ -115,8 +115,7 @@ static void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link,
       surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy);
 
   if (link->properties) {
-    for (auto const& elm : *link->properties)
-      l->set_property(elm.first, elm.second);
+    l->set_properties(*link->properties);
   }
 
   if (link->latency_trace)
@@ -362,8 +361,7 @@ void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage
   auto s = surf_storage_model->createStorage(storage->id, stype->id, storage->content, storage->attach);
 
   if (storage->properties) {
-    for (auto const& elm : *storage->properties)
-      s->set_property(elm.first, elm.second);
+    s->set_properties(*storage->properties);
     delete storage->properties;
   }
 }
@@ -450,12 +448,12 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
 
     XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time);
     simgrid::simix::Timer::set(start_time, [arg, auto_restart]() {
-      simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create(
+      simgrid::kernel::actor::ActorImplPtr new_actor = simgrid::kernel::actor::ActorImpl::create(
           arg->name.c_str(), std::move(arg->code), arg->data, arg->host, arg->properties.get(), nullptr);
       if (arg->kill_time >= 0)
-        actor->set_kill_time(arg->kill_time);
+        new_actor->set_kill_time(arg->kill_time);
       if (auto_restart)
-        actor->set_auto_restart(auto_restart);
+        new_actor->set_auto_restart(auto_restart);
       delete arg;
     });
   } else {                      // start_time <= SIMIX_get_clock()