Skip to content

Commit 81bd799

Browse files
Adding documentation to CopyFrom and MergeFrom of RepeatedField and RepeatedPtrField.
PiperOrigin-RevId: 652723222
1 parent d911161 commit 81bd799

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/google/protobuf/repeated_field.h

+5
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@ class RepeatedField final
223223
void ExtractSubrange(int start, int num, Element* elements);
224224

225225
ABSL_ATTRIBUTE_REINITIALIZES void Clear();
226+
227+
// Appends the elements from `other` after this instance.
228+
// The end result length will be `other.size() + this->size()`.
226229
void MergeFrom(const RepeatedField& other);
230+
231+
// Replaces the contents with a copy of the elements from `other`.
227232
ABSL_ATTRIBUTE_REINITIALIZES void CopyFrom(const RepeatedField& other);
228233

229234
// Replaces the contents with RepeatedField(begin, end).

src/google/protobuf/repeated_ptr_field.h

+5
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,12 @@ class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
10441044
void DeleteSubrange(int start, int num);
10451045

10461046
ABSL_ATTRIBUTE_REINITIALIZES void Clear();
1047+
1048+
// Appends the elements from `other` after this instance.
1049+
// The end result length will be `other.size() + this->size()`.
10471050
void MergeFrom(const RepeatedPtrField& other);
1051+
1052+
// Replaces the contents with a copy of the elements from `other`.
10481053
ABSL_ATTRIBUTE_REINITIALIZES void CopyFrom(const RepeatedPtrField& other);
10491054

10501055
// Replaces the contents with RepeatedPtrField(begin, end).

0 commit comments

Comments
 (0)