From c928b1ce3c1e95b1fd3fa15b9a6e4476c6863fd8 Mon Sep 17 00:00:00 2001 From: Lingjie Zhu Date: Thu, 28 Feb 2019 18:48:28 +0800 Subject: [PATCH] early exit when request #proxies is greater than #connected_components --- .../include/CGAL/Variational_shape_approximation.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h index a6835a190b9..2e8e90c82b2 100644 --- a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h @@ -342,6 +342,8 @@ public: // initialize proxies and the proxy map to prepare for insertion bootstrap_from_connected_components(); + if (max_nb_proxies <= m_proxies.size()) + return m_proxies.size(); switch (method) { case Surface_mesh_approximation::RANDOM: return init_random(max_nb_proxies, min_error_drop, nb_relaxations);