Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Is seems as right as before, only shorter
authorscastelli <stephane.castelli@inria.fr>
Wed, 4 Jun 2014 13:28:54 +0000 (15:28 +0200)
committerscastelli <stephane.castelli@inria.fr>
Wed, 4 Jun 2014 13:29:28 +0000 (15:29 +0200)
src/surf/network_constant.cpp

index b3cd6f9..1f17a2c 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;