Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use (const) references with range-based for loops.
[simgrid.git] / src / surf / plugins / host_load.cpp
index 71ccf35..99e7a39 100644 (file)
@@ -127,7 +127,7 @@ static void onHostChange(simgrid::s4u::Host& host)
 /* This callback is called when an action (computation, idle, ...) terminates */
 static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf::Action::State previous)
 {
-  for (simgrid::surf::Cpu* cpu : action->cpus()) {
+  for (simgrid::surf::Cpu* const& cpu : action->cpus()) {
     simgrid::s4u::Host* host = cpu->getHost();
 
     if (host != nullptr) {