diff options
Diffstat (limited to 'include/llvm/ADT/SmallVector.h')
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 2a5168c261..e5e53d1dd6 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -451,10 +451,12 @@ public: void assign(unsigned NumElts, const T &Elt) { clear(); - if (this->capacity() < NumElts) - this->grow(NumElts); - this->setEnd(this->begin()+NumElts); - std::uninitialized_fill(this->begin(), this->end(), Elt); + append(NumElts, Elt); + } + + template <typename in_iter> void assign(in_iter S, in_iter E) { + clear(); + append(S, E); } iterator erase(iterator I) { |