From a5a831e62e34f857480aaba0592b0cdc762fcffb Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 29 May 2015 15:46:08 +0300 Subject: [PATCH] Optimize the result creation: do not set/unset naming if it is not necessary --- src/Model/Model_ResultBody.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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())); -- 2.39.2