diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-05 22:14:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-05 22:14:48 +0000 |
commit | b25e44ec1506cd42ab676ac7ddf8dc8f228bcada (patch) | |
tree | c0bc7a2063fd07302bc63bd99067943bf0f6fb5c | |
parent | 50bee42b54cd9aec5f49566307df2b0cf23afcf6 (diff) |
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149850 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 30fc424a1d..90a52b8adb 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -688,9 +688,7 @@ public: explicit SmallVector(unsigned Size, const T &Value = T()) : SmallVectorImpl<T>(NumTsAvailable) { - this->reserve(Size); - while (Size--) - this->push_back(Value); + this->assign(Size, Value); } template<typename ItTy> @@ -720,9 +718,7 @@ public: explicit SmallVector(unsigned Size, const T &Value = T()) : SmallVectorImpl<T>(0) { - this->reserve(Size); - while (Size--) - this->push_back(Value); + this->assign(Size, Value); } template<typename ItTy> |