Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
At most one resource allocation per statement (sonar).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 5 Mar 2021 10:33:18 +0000 (11:33 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 7 Mar 2021 10:53:32 +0000 (11:53 +0100)
src/kernel/routing/NetZoneImpl.cpp

index 6e5038a..deddfa2 100644 (file)
@@ -79,7 +79,8 @@ s4u::Host* NetZoneImpl::create_host(const std::string& name, const std::vector<d
   if (hierarchy_ == RoutingMode::unset)
     hierarchy_ = RoutingMode::base;
 
-  auto* res = (new s4u::Host(name))->set_netpoint(new NetPoint(name, NetPoint::Type::Host, this));
+  auto* res = new s4u::Host(name);
+  res->set_netpoint(new NetPoint(name, NetPoint::Type::Host, this));
 
   surf_cpu_model_pm->create_cpu(res, speed_per_pstate, core_amount);