Pull another node_constructor out of a loop.

[SVN r42159]
This commit is contained in:
Daniel James
2007-12-18 23:50:29 +00:00
parent 072a80a3f2
commit a356c67c38

View File

@ -1718,8 +1718,8 @@ namespace boost {
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 @@ namespace boost {
// 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);