Fix bug where container was reducing the number of buckets.

[SVN r56347]
This commit is contained in:
Daniel James
2009-09-21 21:17:40 +00:00
parent 965c2ae89c
commit ff6e457651
2 changed files with 15 additions and 3 deletions

View File

@@ -406,9 +406,8 @@ namespace boost { namespace unordered_detail {
template <class H, class P, class A, class G, class K>
inline void hash_table<H, P, A, G, K>::create_for_insert(std::size_t size)
{
// TODO: Write a test to detect this bug:
if(size > this->bucket_count_)
this->bucket_count_ = this->min_buckets_for_size(size);
std::size_t min_buckets = this->min_buckets_for_size(size);
if(min_buckets > this->bucket_count_) this->bucket_count_ = min_buckets;
this->create_buckets();
this->init_buckets();
}