Loading llvm/include/llvm/ADT/SmallVector.h +5 −11 Original line number Diff line number Diff line Loading @@ -603,9 +603,7 @@ public: void append(in_iter in_start, in_iter in_end) { this->assertSafeToAddRange(in_start, in_end); size_type NumInputs = std::distance(in_start, in_end); if (NumInputs > this->capacity() - this->size()) this->grow(this->size()+NumInputs); this->reserve(this->size() + NumInputs); this->uninitialized_copy(in_start, in_end, this->end()); this->set_size(this->size() + NumInputs); } Loading Loading @@ -888,10 +886,8 @@ void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS) { std::swap(this->Capacity, RHS.Capacity); return; } if (RHS.size() > this->capacity()) this->grow(RHS.size()); if (this->size() > RHS.capacity()) RHS.grow(this->size()); this->reserve(RHS.size()); RHS.reserve(this->size()); // Swap the shared elements. size_t NumShared = this->size(); Loading Loading @@ -946,8 +942,7 @@ SmallVectorImpl<T> &SmallVectorImpl<T>:: // FIXME: don't do this if they're efficiently moveable. if (this->capacity() < RHSSize) { // Destroy current elements. this->destroy_range(this->begin(), this->end()); this->set_size(0); this->clear(); CurSize = 0; this->grow(RHSSize); } else if (CurSize) { Loading Loading @@ -1006,8 +1001,7 @@ SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) { // elements. if (this->capacity() < RHSSize) { // Destroy current elements. this->destroy_range(this->begin(), this->end()); this->set_size(0); this->clear(); CurSize = 0; this->grow(RHSSize); } else if (CurSize) { Loading Loading
llvm/include/llvm/ADT/SmallVector.h +5 −11 Original line number Diff line number Diff line Loading @@ -603,9 +603,7 @@ public: void append(in_iter in_start, in_iter in_end) { this->assertSafeToAddRange(in_start, in_end); size_type NumInputs = std::distance(in_start, in_end); if (NumInputs > this->capacity() - this->size()) this->grow(this->size()+NumInputs); this->reserve(this->size() + NumInputs); this->uninitialized_copy(in_start, in_end, this->end()); this->set_size(this->size() + NumInputs); } Loading Loading @@ -888,10 +886,8 @@ void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS) { std::swap(this->Capacity, RHS.Capacity); return; } if (RHS.size() > this->capacity()) this->grow(RHS.size()); if (this->size() > RHS.capacity()) RHS.grow(this->size()); this->reserve(RHS.size()); RHS.reserve(this->size()); // Swap the shared elements. size_t NumShared = this->size(); Loading Loading @@ -946,8 +942,7 @@ SmallVectorImpl<T> &SmallVectorImpl<T>:: // FIXME: don't do this if they're efficiently moveable. if (this->capacity() < RHSSize) { // Destroy current elements. this->destroy_range(this->begin(), this->end()); this->set_size(0); this->clear(); CurSize = 0; this->grow(RHSSize); } else if (CurSize) { Loading Loading @@ -1006,8 +1001,7 @@ SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) { // elements. if (this->capacity() < RHSSize) { // Destroy current elements. this->destroy_range(this->begin(), this->end()); this->set_size(0); this->clear(); CurSize = 0; this->grow(RHSSize); } else if (CurSize) { Loading