From d53a9c99fc71fb343e8d695f55e2cdc7ba9a723c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Aug 2023 10:50:13 +0200 Subject: [PATCH] Use st algorithm --- src/OpenMesh/Core/IO/importer/ImporterT.hh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Core/IO/importer/ImporterT.hh b/src/OpenMesh/Core/IO/importer/ImporterT.hh index df38c961..008fc7dc 100644 --- a/src/OpenMesh/Core/IO/importer/ImporterT.hh +++ b/src/OpenMesh/Core/IO/importer/ImporterT.hh @@ -121,14 +121,12 @@ public: VHandles::const_iterator it, it2, end(_indices.end()); - // test for valid vertex indices - for (it=_indices.begin(); it!=end; ++it) - if (! mesh_.is_valid_handle(*it)) - { + // Test if all vertex handles are valid. If not, we throw an error. + if ( std::any_of(_indices.begin(),_indices.end(),[this](const VertexHandle& vh){ return !mesh_.is_valid_handle(vh); } ) ) + { omerr() << "ImporterT: Face contains invalid vertex index\n"; return fh; - } - + } // don't allow double vertices for (it=_indices.begin(); it!=end; ++it)