Salome HOME
Speed up "Clear mesh data"
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 85a1bcda9e37114b81edbabfbfe692ae170e4d92..8945f5e26d4dc7960c50bfbe6c0561fd0d533562 100644 (file)
@@ -195,7 +195,7 @@ void SMESH_subMesh::SetIsAlwaysComputed(bool isAlCo)
 bool SMESH_subMesh::IsEmpty() const
 {
   if (SMESHDS_SubMesh * subMeshDS = ((SMESH_subMesh*)this)->GetSubMeshDS())
-    return (!subMeshDS->GetNodes()->more() && !subMeshDS->GetElements()->more());
+    return (!subMeshDS->NbElements() && !subMeshDS->NbNodes());
   return true;
 }
 
@@ -2078,7 +2078,8 @@ namespace {
               SMESH_subMesh*                 prepend,
               SMESH_subMesh*                 append): myIt(subIt),myAppend(append)
     {
-      myCur = prepend ? prepend : myIt->more() ? myIt->next() : 0;
+      myCur = prepend ? prepend : myIt->more() ? myIt->next() : append;
+      if ( myCur == append ) append = 0;
     }
     /// Return true if and only if there are other object in this iterator
     virtual bool more()