Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Is seems as right as before, only shorter
[simgrid.git] / src / surf / network_constant.cpp
index b3cd6f9c8a034cf6b56ff412d7d1f3beaf896cbe..1f17a2c0f34252c524271d76a9c4f2ea92c0e96d 100644 (file)
@@ -37,12 +37,8 @@ double NetworkConstantModel::shareResources(double /*now*/)
   for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
         ; it != itend ; ++it) {
        action = static_cast<NetworkConstantActionPtr>(&*it);
-    if (action->m_latency > 0) {
-      if (min < 0)
-        min = action->m_latency;
-      else if (action->m_latency < min)
-        min = action->m_latency;
-    }
+        if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
+            min = action->m_latency;
   }
 
   return min;