From b25e44ec1506cd42ab676ac7ddf8dc8f228bcada Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 5 Feb 2012 22:14:48 +0000 Subject: Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149850 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallVector.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 30fc424..90a52b8 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(NumTsAvailable) { - this->reserve(Size); - while (Size--) - this->push_back(Value); + this->assign(Size, Value); } template @@ -720,9 +718,7 @@ public: explicit SmallVector(unsigned Size, const T &Value = T()) : SmallVectorImpl(0) { - this->reserve(Size); - while (Size--) - this->push_back(Value); + this->assign(Size, Value); } template -- cgit v1.1