From: eap Date: Tue, 9 Mar 2010 08:17:43 +0000 (+0000) Subject: a little optimize FindFace (std::vector nodes) X-Git-Tag: V5_1_4a1~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0811f1f0ea2ac08140080d43c2c64ba3366640db;p=modules%2Fsmesh.git a little optimize FindFace (std::vector nodes) --- diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index fb7bd9a94..0f3ea745b 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -1782,15 +1782,10 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace (std::vector nod while (itF->more()) { const SMDS_MeshElement* f = itF->next(); if ( f->NbNodes() == nodes.size() ) { - SMDS_ElemIteratorPtr it2 = f->nodesIterator(); - while(it2->more()) { - if ( find( nodes.begin(), nodes.end(), it2->next() ) == nodes.end() ) { - f = 0; - break; - } - } - if ( f ) - return static_cast (f); + for ( int i = 1; i < nodes.size(); ++ i ) + if ( f->GetNodeIndex( nodes[ i ]) < 0 ) + return NULL; + return static_cast (f); } } }