Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2007-12-18 18:50:29


Author: danieljames
Date: 2007-12-18 18:50:29 EST (Tue, 18 Dec 2007)
New Revision: 42159
URL: http://svn.boost.org/trac/boost/changeset/42159

Log:
Pull another node_constructor out of a loop.
Text files modified:
   sandbox/unordered/boost/unordered/detail/hash_table_impl.hpp | 5 ++---
   1 files changed, 2 insertions(+), 3 deletions(-)

Modified: sandbox/unordered/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- sandbox/unordered/boost/unordered/detail/hash_table_impl.hpp (original)
+++ sandbox/unordered/boost/unordered/detail/hash_table_impl.hpp 2007-12-18 18:50:29 EST (Tue, 18 Dec 2007)
@@ -1718,8 +1718,8 @@
             template <typename InputIterator>
             void insert(InputIterator i, InputIterator j)
             {
- // If only inserting 1 element, get the required
- // safety since insert is only called once.
+ node_constructor a(this->allocators_);
+
                 for (; i != j; ++i) {
                     // No side effects in this initial code
                     size_type hash_value = hash_function()(extract_key(*i));
@@ -1733,7 +1733,6 @@
 
                         // Create the node before rehashing in case it throws an
                         // exception (need strong safety in such a case).
- node_constructor a(this->allocators_);
                         value_type const& v = *i;
                         a.construct(v);
 


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