From 0811f1f0ea2ac08140080d43c2c64ba3366640db Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 9 Mar 2010 08:17:43 +0000 Subject: [PATCH] a little optimize FindFace (std::vector nodes) --- src/SMDS/SMDS_Mesh.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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); } } } -- 2.39.2