mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Hopefully a bit more readable.
This commit is contained in:
@ -404,12 +404,17 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
{
|
{
|
||||||
std::size_t key_hash = this->hash(k);
|
std::size_t key_hash = this->hash(k);
|
||||||
iterator pos = this->find_node(key_hash, k);
|
iterator pos = this->find_node(key_hash, k);
|
||||||
if (pos.node_) return emplace_return(pos, false);
|
if (pos.node_) {
|
||||||
pos = this->resize_and_add_node(
|
return emplace_return(pos, false);
|
||||||
boost::unordered::detail::func::construct_value_generic(
|
}
|
||||||
this->node_alloc(), BOOST_UNORDERED_EMPLACE_FORWARD),
|
else {
|
||||||
key_hash);
|
return emplace_return(
|
||||||
return emplace_return(pos, true);
|
this->resize_and_add_node(
|
||||||
|
boost::unordered::detail::func::construct_value_generic(
|
||||||
|
this->node_alloc(), BOOST_UNORDERED_EMPLACE_FORWARD),
|
||||||
|
key_hash),
|
||||||
|
true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
|
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
|
||||||
@ -424,9 +429,14 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
key_type const& k = this->get_key(b.node_->value());
|
key_type const& k = this->get_key(b.node_->value());
|
||||||
std::size_t key_hash = this->hash(k);
|
std::size_t key_hash = this->hash(k);
|
||||||
iterator pos = this->find_node(key_hash, k);
|
iterator pos = this->find_node(key_hash, k);
|
||||||
if (pos.node_) { return emplace_return(pos, false); }
|
if (pos.node_) {
|
||||||
this->reserve_for_insert(this->size_ + 1);
|
return emplace_return(pos, false);
|
||||||
return emplace_return(this->add_node(b.release(), key_hash), true);
|
}
|
||||||
|
else {
|
||||||
|
return emplace_return(
|
||||||
|
this->resize_and_add_node(b.release(), key_hash),
|
||||||
|
true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user