From 05d1cfa9b342bc48446f4fe43a73cd8f7ae94227 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 11 Apr 2024 11:18:07 +0200 Subject: [PATCH] speed-up is_edge with function_output_iterator. --- .../CGAL/Triangulation_data_structure_3.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 44633da0895..db844641a9a 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -2061,18 +2062,17 @@ is_edge(Vertex_handle u, Vertex_handle v, if (u==v) return false; - std::vector cells; - cells.reserve(64); - incident_cells(u, std::back_inserter(cells)); + bool result = false; - for (typename std::vector::iterator cit = cells.begin(); - cit != cells.end(); ++cit) - if ((*cit)->has_vertex(v, j)) { - c = *cit; - i = c->index(u); - return true; - } - return false; + incident_cells(u, boost::make_function_output_iterator([&](Cell_handle ch) { + if(ch->has_vertex(v, j)) { + c = ch; + i = c->index(u); + result = true; + } + })); + + return result; } template