From: ptv Date: Wed, 17 Nov 2010 08:20:26 +0000 (+0000) Subject: optimise code X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2592a4ecc4f6c016cffe9637308efc70bf564de0;p=modules%2Fgui.git optimise code --- diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 8e39ab66b..e8415e344 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -951,12 +951,16 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy ) for( QList::const_iterator it = mods.begin(); it != mods.end(); ++it ) { CAM_DataModel* dm = (*it)->dataModel(); - if( (*it) == this && !camStudy->containsDataModel( dm ) ) + if( (*it) == this ) { - if ( prev ) - camStudy->insertDataModel( (*it)->dataModel(), prev ); - else - camStudy->insertDataModel( (*it)->dataModel(), 0 ); + if ( !camStudy->containsDataModel( dm ) ) + { + if ( prev ) + camStudy->insertDataModel( (*it)->dataModel(), prev ); + else + camStudy->insertDataModel( (*it)->dataModel(), 0 ); + } + return; } prev = dm; }