added small optimization in range_collect_vectors - erase() replaced by copy from back and pop_back()

This commit is contained in:
Adam Wulkiewicz
2014-01-22 22:14:09 +01:00
parent 50fe5a7e67
commit 33f9c05258

View File

@@ -161,7 +161,12 @@ struct range_collect_vectors
c_iterator first = collection.begin() + c_old_size;
if ( first->same_direction(collection.back()) )
collection.erase(first);
{
//collection.erase(first);
// O(1) instead of O(N)
*first = collection.back();
collection.pop_back();
}
}
}
};