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