diff options
author | Vasily Gerasimov <UgnineSirdis@gmail.com> | 2022-02-10 16:49:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:09 +0300 |
commit | 6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (patch) | |
tree | f69637041e6fed76ebae0c74ae1fa0c4be6ab5b4 /library/cpp/protobuf/util/repeated_field_utils.h | |
parent | e5d4696304c6689379ac7ce334512404d4b7836c (diff) | |
download | ydb-6cdc8f140213c595e4ad38bc3d97fcef1146b8c3.tar.gz |
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 1 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 c07bd84647..8f7428b5dc 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) { |