Skip to content

Commit 3d891d2

Browse files
committed
Address comments
1 parent 078be5e commit 3d891d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/include/llvm/ADT/SmallVector.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,9 @@ class SmallVectorImpl : public SmallVectorTemplateBase<T> {
707707
size_type InitialSize = this->size();
708708
size_type ExtraCap = this->capacity() - InitialSize;
709709
size_type NumCopied = 0;
710-
for (; NumCopied != ExtraCap && It != in_end; ++It, ++NumCopied) {
710+
for (; NumCopied != ExtraCap && It != in_end; ++It, ++NumCopied)
711711
::new ((void *)(Dest + NumCopied)) T(*It);
712-
}
712+
713713
size_type NewSize = InitialSize + NumCopied;
714714
this->set_size(NewSize);
715715

@@ -910,7 +910,8 @@ class SmallVectorImpl : public SmallVectorTemplateBase<T> {
910910
// Convert iterator to elt# to avoid invalidating iterator when we reserve()
911911
size_t InsertElt = I - this->begin();
912912

913-
if (I == this->end()) { // Important special case for empty vector.
913+
// Important special case for appending to a vector, including empty vector.
914+
if (I == this->end()) {
914915
append(From, To);
915916
return this->begin()+InsertElt;
916917
}

0 commit comments

Comments
 (0)