From c27c162950ac6ffef1f89b3deb3e82f2388d7e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 6 Apr 2022 12:08:14 +0200 Subject: [PATCH] remove useless function even worse some useless cleaning was done before deallocation --- Hash_map/include/CGAL/Tools/chained_map.h | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/Hash_map/include/CGAL/Tools/chained_map.h b/Hash_map/include/CGAL/Tools/chained_map.h index 621de07d425..43bd49f1ac6 100644 --- a/Hash_map/include/CGAL/Tools/chained_map.h +++ b/Hash_map/include/CGAL/Tools/chained_map.h @@ -87,7 +87,6 @@ public: chained_map& operator=(const chained_map& D); void reserve(std::size_t n); - void clear_entries(); void clear(); ~chained_map() { @@ -252,12 +251,7 @@ chained_map::chained_map(const chained_map& D) template chained_map& chained_map::operator=(const chained_map& D) { - clear_entries(); - - for (chained_map_item item = table ; item != table_end ; ++item) - destroy(item); - - alloc.deallocate(table, table_end - table); + clear(); init_table(D.table_size); @@ -277,25 +271,12 @@ void chained_map::reserve(std::size_t n) reserved_size = n; } -template -void chained_map::clear_entries() -{ - if(!table) - return; - - for(chained_map_item p = table; p < free; p++) - if (p->k != nullptrKEY || p >= table + table_size) - p->i = T(); -} - template void chained_map::clear() { if(!table) return; - clear_entries(); - for (chained_map_item item = table ; item != table_end ; ++item) destroy(item); alloc.deallocate(table, table_end - table);