From: Benjamin Kramer Date: Sun, 5 Feb 2012 22:14:48 +0000 (+0000) Subject: Simplify code. No functionality change. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b25e44ec1506cd42ab676ac7ddf8dc8f228bcada;p=oota-llvm.git Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149850 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 30fc424a1d0..90a52b8adbd 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