aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/SmallVector.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/SmallVector.h')
-rw-r--r--include/llvm/ADT/SmallVector.h8
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>