From da675994d2a3f9dda88cc2e7d35c497f43f3fce9 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 19 Nov 2010 13:27:33 +0000 Subject: [PATCH] 0020463: EDF 1099 SMESH: performance regression from V4 to V5 Patch from Erwan ADAM. --- src/SMESH_I/SMESH_Gen_i_1.cxx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index d1638dd86..5a82382d6 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -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) { -- 2.39.2