Simplify code. No functionality change.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 5 Feb 2012 22:14:48 +0000 (22:14 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 5 Feb 2012 22:14:48 +0000 (22:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149850 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallVector.h

index 30fc424a1d0b419187bf318b2803e2054a10b181..90a52b8adbd5348c295f3d10e845f7a78e0da2dd 100644 (file)
@@ -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>