From 5490bcfe95b6b7d3b5000575aac8e34808924ab1 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 14 Aug 2016 20:55:40 +0100 Subject: [PATCH] Remove node_tmp overload of add_node. --- include/boost/unordered/detail/equivalent.hpp | 13 +++---------- include/boost/unordered/detail/unique.hpp | 15 ++++----------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/include/boost/unordered/detail/equivalent.hpp b/include/boost/unordered/detail/equivalent.hpp index ea8d34d9..fdd18895 100644 --- a/include/boost/unordered/detail/equivalent.hpp +++ b/include/boost/unordered/detail/equivalent.hpp @@ -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) diff --git a/include/boost/unordered/detail/unique.hpp b/include/boost/unordered/detail/unique.hpp index 80f21cbb..73852793 100644 --- a/include/boost/unordered/detail/unique.hpp +++ b/include/boost/unordered/detail/unique.hpp @@ -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); }