Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
these models want to please Sonar
[simgrid.git] / src / surf / cpu_cas01.cpp
index 04db0b1..1f5ebb5 100644 (file)
@@ -114,7 +114,7 @@ void CpuCas01::onSpeedChange() {
     CpuCas01Action* action = static_cast<CpuCas01Action*>(lmm_variable_id(var));
 
     lmm_update_variable_bound(model()->getMaxminSystem(), action->getVariable(), speed_.scale * speed_.peak);
-    }
+  }
 
   Cpu::onSpeedChange();
 }
@@ -179,7 +179,7 @@ CpuAction *CpuCas01::sleep(double duration)
   // FIXME: sleep variables should not consume 1.0 in lmm_expand
   action->maxDuration_ = duration;
   action->suspended_ = 2;
-  if (duration == NO_MAX_DURATION) {
+  if (duration < 0) { // NO_MAX_DURATION
     /* Move to the *end* of the corresponding action set. This convention is used to speed up update_resource_state */
     action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
     action->stateSet_ = static_cast<CpuCas01Model*>(model())->p_cpuRunningActionSetThatDoesNotNeedBeingChecked;