Remove node_tmp overload of add_node.

This commit is contained in:
Daniel James
2016-08-14 20:55:40 +01:00
parent 078c562b6c
commit 5490bcfe95
2 changed files with 7 additions and 21 deletions

View File

@ -381,14 +381,6 @@ namespace boost { namespace unordered { namespace detail {
pos->group_prev_ = n;
}
inline iterator add_node(
node_tmp& a,
std::size_t key_hash,
iterator pos)
{
return add_node(a.release(), key_hash, pos);
}
inline iterator add_node(
node_pointer n,
std::size_t key_hash,
@ -442,14 +434,15 @@ namespace boost { namespace unordered { namespace detail {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
return this->add_node(a, key_hash, position);
return this->add_node(a.release(), key_hash, position);
}
void emplace_impl_no_rehash(node_tmp& a)
{
key_type const& k = this->get_key(a.value());
std::size_t key_hash = this->hash(k);
this->add_node(a, key_hash, this->find_node(key_hash, k));
iterator position = this->find_node(key_hash, k);
this->add_node(a.release(), key_hash, position);
}
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)

View File

@ -308,13 +308,6 @@ namespace boost { namespace unordered { namespace detail {
// Emplace/Insert
inline iterator add_node(
node_tmp& a,
std::size_t key_hash)
{
return add_node(a.release(), key_hash);
}
inline iterator add_node(
node_pointer n,
std::size_t key_hash)
@ -351,7 +344,7 @@ namespace boost { namespace unordered { namespace detail {
{
node_tmp b(n, this->node_alloc());
this->reserve_for_insert(this->size_ + 1);
return this->add_node(b, key_hash);
return this->add_node(b.release(), key_hash);
}
value_type& operator[](key_type const& k)
@ -437,7 +430,7 @@ namespace boost { namespace unordered { namespace detail {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
return emplace_return(this->add_node(b, key_hash), true);
return emplace_return(this->add_node(b.release(), key_hash), true);
}
////////////////////////////////////////////////////////////////////////
@ -487,7 +480,7 @@ namespace boost { namespace unordered { namespace detail {
boost::unordered::detail::insert_size(i, j));
// Nothing after this point can throw.
this->add_node(b, key_hash);
this->add_node(b.release(), key_hash);
}
}
@ -513,7 +506,7 @@ namespace boost { namespace unordered { namespace detail {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
this->reserve_for_insert(this->size_ + 1);
this->add_node(b, key_hash);
this->add_node(b.release(), key_hash);
}
} while(++i != j);
}