aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Dumont <fdumont@gcc.gnu.org>2024-04-25 18:45:59 +0200
committerFrançois Dumont <frs.dumont@gmail.com>2024-06-10 18:57:32 +0200
commit6ef888177251653fd89b9f127d707bdad04eecbe (patch)
tree1cfd5156917bfeecb7ac89eedf99acf2e27e19c9
parentc3d1153bc0a2b820e3c373ecf19a5a127703f854 (diff)
downloadgcc-6ef888177251653fd89b9f127d707bdad04eecbe.zip
gcc-6ef888177251653fd89b9f127d707bdad04eecbe.tar.gz
gcc-6ef888177251653fd89b9f127d707bdad04eecbe.tar.bz2
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.
-rw-r--r--libstdc++-v3/include/bits/hashtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index cd3e1ac..6e78cb7 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();
}