Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix example (bummer)
[simgrid.git] / src / surf / plugins / host_load.cpp
index 54761f1..5225633 100644 (file)
@@ -118,12 +118,11 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf:
   for (simgrid::surf::Cpu* cpu : action->cpus()) {
     simgrid::s4u::Host* host = cpu->getHost();
 
-    if (host == nullptr)
-      continue;
-
-    // Get the host_load extension for the relevant host
-    HostLoad* host_load = host->extension<HostLoad>();
-    host_load->update();
+    if (host != nullptr) {
+      // Get the host_load extension for the relevant host
+      HostLoad* host_load = host->extension<HostLoad>();
+      host_load->update();
+    }
   }
 }