Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / src / surf / cpu_interface.cpp
index 768c419..a22fd69 100644 (file)
@@ -46,16 +46,12 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     //without losing the event ascending order (considering all CPU's)
     double smaller = -1;
     ActionList *actionSet = getRunningActionSet();
-    for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
-       ; it != itend ; ++it) {
+    ActionList::iterator it(actionSet->begin());
+    ActionList::iterator itend(actionSet->end());
+    for (; it != itend; ++it) {
       CpuAction *action = static_cast<CpuAction*>(&*it);
-        if (smaller < 0) {
-          smaller = action->getLastUpdate();
-          continue;
-        }
-        if (action->getLastUpdate() < smaller) {
-          smaller = action->getLastUpdate();
-        }
+      if (smaller < 0 || action->getLastUpdate() < smaller)
+        smaller = action->getLastUpdate();
     }
     if (smaller > 0) {
       TRACE_last_timestamp_to_dump = smaller;
@@ -67,9 +63,10 @@ void CpuModel::updateActionsStateFull(double now, double delta)
 {
   CpuAction *action = nullptr;
   ActionList *running_actions = getRunningActionSet();
-
-  for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
-     ; it != itend ; it=itNext) {
+  ActionList::iterator it(running_actions->begin());
+  ActionList::iterator itNext = it;
+  ActionList::iterator itend(running_actions->end());
+  for (; it != itend; it = itNext) {
     ++itNext;
     action = static_cast<CpuAction*>(&*it);
     if (TRACE_is_enabled()) {