diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-06-08 19:12:31 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-06-08 19:12:31 +0000 |
| commit | 402cb2c981d0b2ac27ddf1d0ccf761bf94625811 (patch) | |
| tree | 9e523c4d397328974f5629485d7ce7afc02a0c93 /llvm/include | |
| parent | ae8a932ed8d48206394e1194f19e0832e4079dc9 (diff) | |
| download | bcm5719-llvm-402cb2c981d0b2ac27ddf1d0ccf761bf94625811.tar.gz bcm5719-llvm-402cb2c981d0b2ac27ddf1d0ccf761bf94625811.zip | |
SmallVector: More movable improvements - don't copy elements to make space when inserting repeated elements.
Also split and improve tests a bit.
llvm-svn: 210433
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/ADT/SmallVector.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index 075b13084aa..c00248dab57 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -609,7 +609,8 @@ public: // reallocate the vector. if (size_t(this->end()-I) >= NumToInsert) { T *OldEnd = this->end(); - append(this->end()-NumToInsert, this->end()); + append(std::move_iterator<iterator>(this->end() - NumToInsert), + std::move_iterator<iterator>(this->end())); // Copy the existing elements that get replaced. this->move_backward(I, OldEnd-NumToInsert, OldEnd); |

