From: mpv Date: Fri, 29 May 2015 12:46:08 +0000 (+0300) Subject: Optimize the result creation: do not set/unset naming if it is not necessary X-Git-Tag: V_1.2.0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5a831e62e34f857480aaba0592b0cdc762fcffb;p=modules%2Fshaper.git Optimize the result creation: do not set/unset naming if it is not necessary --- diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index afc1c21c8..704de68d8 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -66,7 +66,12 @@ static void EvolutionToSelection(TDF_Label theLab, const bool theFlag) { Handle(TNaming_NamedShape) aName; int anEvolution = -1; if (theLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) { - anEvolution = (int)(aName->Evolution()); + TNaming_Evolution aNSEvol = aName->Evolution(); + if ((aNSEvol == TNaming_SELECTED && theFlag) || + (aNSEvol != TNaming_SELECTED && !theFlag)) { // nothing to do, it is already correct + return; + } + anEvolution = (int)(aNSEvol); for(TNaming_Iterator anIter(aName); anIter.More(); anIter.Next()) { aShapePairs.push_back(std::pair (anIter.OldShape(), anIter.NewShape()));