From 899248acbfdf984fdcd89f44867d3fcd73b30eb0 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 29 Apr 2017 09:31:17 +0100 Subject: [PATCH] Avoid shadow warning on older versions off GCC --- include/boost/unordered/detail/implementation.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index ee6d8d0c..815ee916 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -3338,11 +3338,11 @@ struct table : boost::unordered::detail::functionshash_to_bucket(key_hash); - bucket_pointer b = this->get_bucket(bucket); + std::size_t bucket_index = this->hash_to_bucket(key_hash); + bucket_pointer b = this->get_bucket(bucket_index); // TODO: Do this need to set_first_in_group ? - n->bucket_info_ = bucket; + n->bucket_info_ = bucket_index; n->set_first_in_group(); if (!b->next_) { @@ -3875,21 +3875,21 @@ struct table : boost::unordered::detail::functionshash_to_bucket(key_hash); - n->bucket_info_ = bucket; + std::size_t bucket_index = this->hash_to_bucket(key_hash); + n->bucket_info_ = bucket_index; if (pos) { n->next_ = pos->next_; pos->next_ = n; if (n->next_) { std::size_t next_bucket = this->node_bucket(next_node(n)); - if (next_bucket != bucket) { + if (next_bucket != bucket_index) { this->get_bucket(next_bucket)->next_ = n; } } } else { n->set_first_in_group(); - bucket_pointer b = this->get_bucket(bucket); + bucket_pointer b = this->get_bucket(bucket_index); if (!b->next_) { link_pointer start_node = this->get_previous_start();