From 448c340d3a57f0d3617306b543c6b9f8a03a60d1 Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Thu, 28 Oct 2021 21:21:15 +0200 Subject: [PATCH] removed useless selection count call in append --- vcg/complex/append.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/vcg/complex/append.h b/vcg/complex/append.h index bba38581..33229da3 100644 --- a/vcg/complex/append.h +++ b/vcg/complex/append.h @@ -299,9 +299,10 @@ static void MeshAppendConst( // vertex remap.vert.resize(mr.vert.size(), Remap::InvalidIndex()); VertexIteratorLeft vp; - size_t svn = UpdateSelection::VertexCount(mr); - if(selected) + if(selected){ + size_t svn = UpdateSelection::VertexCount(mr); vp=Allocator::AddVertices(ml,int(svn)); + } else vp=Allocator::AddVertices(ml,mr.vn); @@ -317,8 +318,10 @@ static void MeshAppendConst( // edge remap.edge.resize(mr.edge.size(), Remap::InvalidIndex()); EdgeIteratorLeft ep; - size_t sen = UpdateSelection::EdgeCount(mr); - if(selected) ep=Allocator::AddEdges(ml,sen); + if(selected) { + size_t sen = UpdateSelection::EdgeCount(mr); + ep=Allocator::AddEdges(ml,sen); + } else ep=Allocator::AddEdges(ml,mr.en); ForEachEdge(mr, [&](const EdgeRight& e) @@ -333,8 +336,10 @@ static void MeshAppendConst( // face remap.face.resize(mr.face.size(), Remap::InvalidIndex()); FaceIteratorLeft fp; - size_t sfn = UpdateSelection::FaceCount(mr); - if(selected) fp=Allocator::AddFaces(ml,sfn); + if(selected) { + size_t sfn = UpdateSelection::FaceCount(mr); + fp=Allocator::AddFaces(ml,sfn); + } else fp=Allocator::AddFaces(ml,mr.fn); ForEachFace(mr, [&](const FaceRight& f)