[PATCH 2/5][_Hashtable] New method to check current bucket
François Dumont
frs.dumont@gmail.com
Mon Jun 20 16:57:51 GMT 2022
libstdc++: [_Hashtable] Use next bucket node and equal_to to check if
same bucket
To find out if we are still in the same bucket we can first check that
current node
is not the next bucket's before-begin and then that hash code are equals
when cached.
If not we can also use the equal_to functor in a multi-container
context. As a last
resort, compute node bucket index.
libstdc++-v3/ChangeLog:
* include/bits/hashtable_policy.h
(_Hashtable_base<>::_S_hash_code_equals): New.
* include/bits/hashtable.h (_Hashtable<>::_M_is_in_bucket): New,
use latter.
(_Hashtable<>::_M_find_before_node): Use latter.
(_Hashtable<>::_M_find_before_node_tr): Likewise.
Tested under Linux x86_64.
François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_hashtable_is_in_bucket.patch
Type: text/x-patch
Size: 3165 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20220620/46b4b2ca/attachment.bin>
More information about the Libstdc++
mailing list