From: François Dumont Date: Thu, 25 Apr 2024 16:45:59 +0000 (+0200) Subject: libstdc++: [_Hashtable] Optimize destructor X-Git-Tag: basepoints/gcc-16~8387 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ef888177251653fd89b9f127d707bdad04eecbe;p=thirdparty%2Fgcc.git libstdc++: [_Hashtable] Optimize destructor Hashtable destructor do not need to call clear() method that in addition to destroying all nodes also reset all buckets to nullptr. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (~_Hashtable()): Replace clear call with a _M_deallocate_nodes call. --- diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index cd3e1ac297c..6e78cb7d9c0 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -1664,7 +1664,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "Cache the hash code or qualify your functors involved" " in hash code and bucket index computation with noexcept"); - clear(); + this->_M_deallocate_nodes(_M_begin()); _M_deallocate_buckets(); }