Salome HOME
WIP
[modules/yacs.git] / src / engine / ForEachLoop.cxx
index 76eebb5a7cb21c1c31591441469a042c970fdc46..bafdb85d6153fb09e07c16b32a7b033fa9106e22 100644 (file)
@@ -526,7 +526,8 @@ void ForEachLoop::exUpdateState()
     {
       //internal graph update
       int i;
-      int nbOfBr(_nbOfBranches->getIntValue()),nbOfElts(_splitterNode.getNumberOfElements()),nbOfEltsDone(0);
+      int nbOfElts(_splitterNode.getNumberOfElements()),nbOfEltsDone(0);
+      int nbOfBr(_nbOfBranches->getNumberOfBranches(nbOfElts));
       if(_passedData)
         {
           _passedData->checkCompatibilyWithNb(nbOfElts);
@@ -1168,8 +1169,9 @@ list<ProgressWeight> ForEachLoop::getProgressWeight() const
 
 int ForEachLoop::getNbOfElementsToBeProcessed() const
 {
-  int nbBranches = _nbOfBranches->getIntValue();
-  return _splitterNode.getNumberOfElements()
+  int nbOfElems(_splitterNode.getNumberOfElements());
+  int nbBranches = _nbOfBranches->getNumberOfBranches(nbOfElems);
+  return nbOfElems
          + (_initNode ? nbBranches:0)
          + (_finalizeNode ? nbBranches:0) ;
 }