diff options
| author | Vasily Gerasimov <[email protected]> | 2022-02-10 16:49:10 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:10 +0300 |
| commit | 1eb755fbca92172a6aec2f57371b2b3a19dfab43 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/util/repeated_field_utils.h | |
| parent | 6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (diff) | |
Restoring authorship annotation for Vasily Gerasimov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/util/repeated_field_utils.h')
| -rw-r--r-- | library/cpp/protobuf/util/repeated_field_utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/cpp/protobuf/util/repeated_field_utils.h b/library/cpp/protobuf/util/repeated_field_utils.h index 8f7428b5dc7..c07bd846475 100644 --- a/library/cpp/protobuf/util/repeated_field_utils.h +++ b/library/cpp/protobuf/util/repeated_field_utils.h @@ -38,8 +38,8 @@ namespace NProtoBuf { T* ret = field->Add(); MoveRepeatedFieldItem(field, field->size() - 1, index); return ret; - } - + } + template <typename TRepeated> // suitable both for RepeatedField and RepeatedPtrField static void RemoveRepeatedFieldItem(TRepeated* field, size_t index) { if ((int)index >= field->size()) @@ -70,8 +70,8 @@ namespace NProtoBuf { for (int i = begIndex; i < endIndex; ++i, ++shiftIndex) field->SwapElements(shiftIndex, i); } - } - + } + // Remove several items at once, could be more efficient compared to calling RemoveRepeatedFieldItem several times template <typename TRepeated> static void RemoveRepeatedFieldItems(TRepeated* field, const TVector<size_t>& sortedIndices) { |
