Remove compilation error when -Wshadow flag is set (#41)

This commit is contained in:
Stainlee Baakhla 2021-02-13 23:55:23 +05:30 committed by GitHub
parent 84c1bee16e
commit a603419b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -1075,14 +1075,14 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy {
m_load_threshold = size_type(float(bucket_count()) * m_max_load_factor);
}
void rehash(size_type count) {
count = std::max(count,
void rehash(size_type count_) {
count_ = std::max(count_,
size_type(std::ceil(float(size()) / max_load_factor())));
rehash_impl(count);
rehash_impl(count_);
}
void reserve(size_type count) {
rehash(size_type(std::ceil(float(count) / max_load_factor())));
void reserve(size_type count_) {
rehash(size_type(std::ceil(float(count_) / max_load_factor())));
}
/*
@ -1305,8 +1305,8 @@ class robin_hash : private Hash, private KeyEqual, private GrowthPolicy {
std::move(value));
}
void rehash_impl(size_type count) {
robin_hash new_table(count, static_cast<Hash&>(*this),
void rehash_impl(size_type count_) {
robin_hash new_table(count_, static_cast<Hash&>(*this),
static_cast<KeyEqual&>(*this), get_allocator(),
m_min_load_factor, m_max_load_factor);

View File

@ -692,8 +692,8 @@ class robin_map {
void min_load_factor(float ml) { m_ht.min_load_factor(ml); }
void max_load_factor(float ml) { m_ht.max_load_factor(ml); }
void rehash(size_type count) { m_ht.rehash(count); }
void reserve(size_type count) { m_ht.reserve(count); }
void rehash(size_type count_) { m_ht.rehash(count_); }
void reserve(size_type count_) { m_ht.reserve(count_); }
/*
* Observers

View File

@ -547,8 +547,8 @@ class robin_set {
void min_load_factor(float ml) { m_ht.min_load_factor(ml); }
void max_load_factor(float ml) { m_ht.max_load_factor(ml); }
void rehash(size_type count) { m_ht.rehash(count); }
void reserve(size_type count) { m_ht.reserve(count); }
void rehash(size_type count_) { m_ht.rehash(count_); }
void reserve(size_type count_) { m_ht.reserve(count_); }
/*
* Observers