From 3fda4e64c0ffbb7699a2c719d2fdce490734953e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 9 Mar 2023 11:29:15 +0100 Subject: [PATCH] Triangulation_3: rewrite the code a little that avoids code like `o_vt_f_pair.second.first` Backport: master --- .../include/CGAL/Triangulation_3.h | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 6e9e6417ed6..4a9f1fbd19d 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -5110,16 +5110,17 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap, // because the infinite vertices are different } - typename Vertex_triple_Facet_map::value_type o_vt_f_pair = *oit; + const auto vertex_triple = oit->first; + const auto facet = oit->second; outer_map.erase(oit); - Cell_handle o_ch = o_vt_f_pair.second.first; - unsigned int o_i = o_vt_f_pair.second.second; + const Cell_handle o_ch = facet.first; + const unsigned int o_i = facet.second; - auto iit = inner_map.find(o_vt_f_pair.first); + const auto iit = inner_map.find(vertex_triple); CGAL_assertion(iit != inner_map.end()); - typename Vertex_triple_Facet_map::value_type i_vt_f_pair = *iit; - Cell_handle i_ch = i_vt_f_pair.second.first; - unsigned int i_i = i_vt_f_pair.second.second; + const auto i_facet = iit->second; + const Cell_handle i_ch = i_facet.first; + const unsigned int i_i = i_facet.second; // Create a new cell and glue it to the outer surface Cell_handle new_ch = tds().create_cell(); @@ -5138,7 +5139,7 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap, { if(index != i_i) { - Facet f = std::pair(new_ch, index); + Facet f{new_ch, index}; Vertex_triple vt = make_vertex_triple(f); make_canonical_oriented_triple(vt); std::swap(vt[1], vt[2]); @@ -5152,9 +5153,9 @@ copy_triangulation_into_hole(const Vertex_handle_unique_hash_map& vmap, else { // glue the faces - typename Vertex_triple_Facet_map::value_type o_vt_f_pair2 = *oit2; - Cell_handle o_ch2 = o_vt_f_pair2.second.first; - int o_i2 = o_vt_f_pair2.second.second; + const auto facet2 = oit2->second; + const Cell_handle o_ch2 = facet2.first; + const int o_i2 = facet2.second; o_ch2->set_neighbor(o_i2, new_ch); new_ch->set_neighbor(index, o_ch2); outer_map.erase(oit2);