Skip chash computation in insert/emplace if the unconstrained hash matches.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276549 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-07-24 06:22:25 +00:00
parent 8b5233f11c
commit d7570906b1
4 changed files with 78 additions and 1 deletions

View File

@@ -1961,7 +1961,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const&
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
__constrain_hash(__nd->__hash(), __bc) == __chash;
(__nd->__hash() == __hash || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
if (key_eq()(__nd->__upcast()->__value_, __k))