From 08f6efc8271e6a7c266ead7a856c83c77e3af22b Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Fri, 15 Apr 2022 11:14:20 +0200 Subject: [PATCH] bug fix in dual for gmap --- Generalized_map/include/CGAL/Generalized_map.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index ee0ac1644dd..26d311532bf 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -2490,7 +2490,7 @@ namespace CGAL { CGAL_assertion( is_without_boundary(dimension) ); CGAL::Unique_hash_map< Dart_handle, Dart_handle,Hash_function > dual; - Dart_handle d, d2, res = amap.null_handle; + Dart_handle d, d2, res = amap.null_handle, newd; // We clear amap. TODO return a new amap ? amap.clear(); @@ -2499,11 +2499,12 @@ namespace CGAL { for ( typename Dart_range::iterator it=darts().begin(); it!=darts().end(); ++it) { - dual[it] = amap.create_dart(); + newd=amap.create_dart(); + dual[it]=newd; internal::Copy_dart_info_functor:: - run(static_cast(amap), static_cast(*this), - it, dual[it]); - if ( it==adart && res==amap.null_handle ) res = dual[it]; + run(static_cast(*this), static_cast(amap), + it, newd); + if ( it==adart && res==amap.null_handle ) { res=newd; } } // Then we link the darts by using the dual formula :