summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-06-08 19:12:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-06-08 19:12:28 +0000
commitaa72ac7dadf8b52506e6ae4695026f55464b043a (patch)
tree70ad98c4fc66dea5a87ece81b647e58522b2d0c6 /include
parentaa53e497791ac984834996332789a14bf262070f (diff)
downloadllvm-aa72ac7dadf8b52506e6ae4695026f55464b043a.tar.gz
llvm-aa72ac7dadf8b52506e6ae4695026f55464b043a.tar.bz2
llvm-aa72ac7dadf8b52506e6ae4695026f55464b043a.tar.xz
SmallVector: Move, don't copy, elements to make space for an insertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SmallVector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h
index 94bd9cc7b2..075b13084a 100644
--- a/include/llvm/ADT/SmallVector.h
+++ b/include/llvm/ADT/SmallVector.h
@@ -555,7 +555,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);