[llvm-commits] [llvm] r149850 - /llvm/trunk/include/llvm/ADT/SmallVector.h
Benjamin Kramer
benny.kra at googlemail.com
Sun Feb 5 14:14:48 PST 2012
Author: d0k
Date: Sun Feb 5 16:14:48 2012
New Revision: 149850
URL: http://llvm.org/viewvc/llvm-project?rev=149850&view=rev
Log:
Simplify code. No functionality change.
Modified:
llvm/trunk/include/llvm/ADT/SmallVector.h
Modified: llvm/trunk/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallVector.h?rev=149850&r1=149849&r2=149850&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h (original)
+++ llvm/trunk/include/llvm/ADT/SmallVector.h Sun Feb 5 16:14:48 2012
@@ -688,9 +688,7 @@
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 @@
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>
More information about the llvm-commits
mailing list