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.
This commit is contained in:
François Dumont 2024-04-25 18:45:59 +02:00 committed by François Dumont
parent c3d1153bc0
commit 6ef8881772

View file

@ -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();
}