mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 11:57:15 +02:00
Pull another node_constructor out of a loop.
[SVN r42159]
This commit is contained in:
@@ -1718,8 +1718,8 @@ namespace boost {
|
|||||||
template <typename InputIterator>
|
template <typename InputIterator>
|
||||||
void insert(InputIterator i, InputIterator j)
|
void insert(InputIterator i, InputIterator j)
|
||||||
{
|
{
|
||||||
// If only inserting 1 element, get the required
|
node_constructor a(this->allocators_);
|
||||||
// safety since insert is only called once.
|
|
||||||
for (; i != j; ++i) {
|
for (; i != j; ++i) {
|
||||||
// No side effects in this initial code
|
// No side effects in this initial code
|
||||||
size_type hash_value = hash_function()(extract_key(*i));
|
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
|
// Create the node before rehashing in case it throws an
|
||||||
// exception (need strong safety in such a case).
|
// exception (need strong safety in such a case).
|
||||||
node_constructor a(this->allocators_);
|
|
||||||
value_type const& v = *i;
|
value_type const& v = *i;
|
||||||
a.construct(v);
|
a.construct(v);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user