Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-23 02:55:43


Author: danieljames
Date: 2008-04-23 02:55:43 EDT (Wed, 23 Apr 2008)
New Revision: 44733
URL: http://svn.boost.org/trac/boost/changeset/44733

Log:
Remove 'reserve_extra'.

Text files modified:
   branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp | 22 +---------------------
   1 files changed, 1 insertions(+), 21 deletions(-)

Modified: branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp 2008-04-23 02:55:43 EDT (Wed, 23 Apr 2008)
@@ -1481,26 +1481,6 @@
                 return need_to_reserve;
             }
 
- // basic exception safety
- //
- // This version of reserve is called when inserting a range
- // into a container with equivalent keys, it creates more buckets
- // if the resulting load factor would be over 80% of the load
- // factor. This is to try to avoid excessive rehashes.
- bool reserve_extra(size_type n)
- {
- using namespace std;
-
- bool need_to_reserve = n >= max_load_;
- // throws - basic:
- if (need_to_reserve) {
- rehash_impl(double_to_size_t(floor(
- n / (double) mlf_ * 1.25)) + 1);
- }
- BOOST_ASSERT(n < max_load_ || n > max_size());
- return need_to_reserve;
- }
-
         public:
 
             // no throw
@@ -1772,7 +1752,7 @@
                 }
                 else {
                     // Only require basic exception safety here
- reserve_extra(size() + distance);
+ reserve(size() + distance);
                     node_constructor a(data_.allocators_);
 
                     for (; i != j; ++i) {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk