Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge if statements.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 15 Nov 2017 15:25:04 +0000 (16:25 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 15 Nov 2017 15:25:04 +0000 (16:25 +0100)
src/surf/maxmin.cpp

index a09b2e5..89e8aca 100644 (file)
@@ -975,13 +975,11 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){
 
     lmm_element_t nextelem = (lmm_element_t)xbt_swag_getNext(elem, cnstr->disabled_element_set.offset);
 
-    if (elem->variable->staged_weight>0 ){
+    if (elem->variable->staged_weight > 0 && lmm_can_enable_var(elem->variable)) {
       //Found a staged variable
       //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that
       //staged variables will eventually be called?
-      if(lmm_can_enable_var(elem->variable)){
-        lmm_enable_var(sys,elem->variable);
-      }
+      lmm_enable_var(sys, elem->variable);
     }
 
     xbt_assert(cnstr->concurrency_current<=cnstr->concurrency_limit,"Concurrency overflow!");