diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 1e315189..7173e8cc 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -2729,11 +2729,6 @@ struct table : boost::unordered::detail::functionsnext_; - } - node_pointer next_group(node_pointer n) const { node_pointer n1 = n; @@ -3020,7 +3015,7 @@ struct table : boost::unordered::detail::functions(prev->next_); + node_pointer n = next_node(prev); prev->next_ = n->next_; BOOST_UNORDERED_CALL_DESTROY( @@ -3082,25 +3077,26 @@ struct table : boost::unordered::detail::functionsnext_; + node_pointer next = next_node(prev); std::size_t bucket_index2 = bucket_index; - if (end) { - bucket_index2 = node_bucket(static_cast(end)); + if (next) { + bucket_index2 = node_bucket(next); - // If begin and end are in the same bucket, then - // there's nothing to do. - if (bucket_index == bucket_index2) + // If next is in the same bucket, then there's nothing to do. + if (bucket_index == bucket_index2) { return bucket_index2; + } - // Update the bucket containing end. + // Update the bucket containing next. get_bucket(bucket_index2)->next_ = prev; } // Check if this bucket is now empty. bucket_pointer this_bucket = get_bucket(bucket_index); - if (this_bucket->next_ == prev) + if (this_bucket->next_ == prev) { this_bucket->next_ = link_pointer(); + } return bucket_index2; } @@ -4047,7 +4043,7 @@ struct table : boost::unordered::detail::functionsget_previous_start(bucket_index); while (prev->next_ != i) { - prev = next_for_erase(prev); + prev = next_node(prev); } prev->next_ = i->next_; @@ -4091,7 +4087,7 @@ struct table : boost::unordered::detail::functionsget_previous_start(bucket_index); while (prev->next_ != i) { - prev = next_for_erase(prev); + prev = next_node(prev); } // Delete the nodes.