]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0020463: EDF 1099 SMESH: performance regression from V4 to V5
authorvsr <vsr@opencascade.com>
Fri, 19 Nov 2010 13:27:33 +0000 (13:27 +0000)
committervsr <vsr@opencascade.com>
Fri, 19 Nov 2010 13:27:33 +0000 (13:27 +0000)
Patch from Erwan ADAM.

src/SMESH_I/SMESH_Gen_i_1.cxx

index d1638dd86abdc1d4f1d00a67f2205ab2c871441a..5a82382d6b1905b033738566dbb925dbf49a0ae0 100644 (file)
@@ -923,7 +923,30 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
   if(!hasAttr)
     aNewParams = anInputParams;
   else 
-    aNewParams = aOldParameters+"|"+anInputParams;
+    {
+      int pos = aOldParameters.SearchFromEnd("|");
+      if(pos==-1) pos = 0;
+      TCollection_AsciiString previousParamFull(aOldParameters.Split(pos));
+      TCollection_AsciiString previousParam(previousParamFull);
+      TCollection_AsciiString theRepet("1");
+      pos = previousParam.SearchFromEnd(";*=");
+      if(pos >= 0)
+        {
+          theRepet = previousParam.Split(pos+2);
+          pos = pos-1;
+          if(pos==-1) pos = 0;
+          previousParam.Split(pos);
+        }
+      if(previousParam == anInputParams)
+        {
+          theRepet = theRepet.IntegerValue()+1;
+          aNewParams = aOldParameters + previousParam + ";*=" + theRepet;
+        }
+      else
+        {
+          aNewParams = aOldParameters + previousParamFull + "|" + anInputParams;
+        }
+    }
 
   if(VARIABLE_DEBUG)
   {