diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2021-10-25 15:59:35 +0200 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2021-11-15 18:52:07 +0100 |
commit | d10b863fa3de8b202aadbdef1b012188ab0868d8 (patch) | |
tree | 6f4311493baaa5509b1c2abe64dee5874baa1fe7 /gcc/gimple-fold.c | |
parent | f861ed8b29a5eb6164d1ddbcfbb6232dddae713f (diff) | |
download | gcc-d10b863fa3de8b202aadbdef1b012188ab0868d8.zip gcc-d10b863fa3de8b202aadbdef1b012188ab0868d8.tar.gz gcc-d10b863fa3de8b202aadbdef1b012188ab0868d8.tar.bz2 |
libstdc++: Unordered containers merge re-use hash code
When merging 2 unordered containers with same hasher we can re-use the hash code from
the cache if any.
Also in the context of the merge operation on multi-container use previous insert iterator as a hint
for the next insert.
libstdc++-v3/ChangeLog:
* include/bits/hashtable_policy.h:
(_Hash_code_base<>::_M_hash_code(const _Hash&, const _Hash_node_value<_Value, true>&)): New.
(_Hash_code_base<>::_M_hash_code<_H2>(const _H2&, const _Hash_node_value<>&)): New.
* include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Use latter.
(_Hashtable<>::_M_merge_multi): Likewise.
* testsuite/23_containers/unordered_multiset/modifiers/merge.cc (test05): New test.
* testsuite/23_containers/unordered_set/modifiers/merge.cc (test04): New test.
Diffstat (limited to 'gcc/gimple-fold.c')
0 files changed, 0 insertions, 0 deletions