File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments