early exit

when request #proxies is greater than #connected_components
This commit is contained in:
Lingjie Zhu 2019-02-28 18:48:28 +08:00
parent 91be8fbcf5
commit c928b1ce3c
1 changed files with 2 additions and 0 deletions

View File

@ -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);