fast return for compacting functions if no compacting is needed

This commit is contained in:
Paolo Cignoni 2008-04-18 17:45:23 +00:00
parent 108af1cd44
commit 820bfdd65e
1 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.42 2008/04/10 09:18:57 cignoni
moved Index function from append to the allocate
Revision 1.41 2008/04/03 22:47:10 cignoni
template the reorder functions on the vector types (for ocf)
@ -400,6 +403,9 @@ namespace vcg {
static void CompactVertexVector( MeshType &m )
{
// If already compacted fast return please!
if(m.vn==m.vert.size()) return;
// newVertIndex [ <old_vert_position> ] gives you the new position of the vertex in the vector;
std::vector<size_t> newVertIndex(m.vert.size(),std::numeric_limits<size_t>::max() );
@ -444,6 +450,9 @@ namespace vcg {
static void CompactFaceVector( MeshType &m )
{
// If already compacted fast return please!
if(m.fn==m.face.size()) return;
// newFaceIndex [ <old_face_position> ] gives you the new position of the face in the vector;
std::vector<size_t> newFaceIndex(m.face.size(),std::numeric_limits<size_t>::max() );