diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/protobuf | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/protobuf')
-rw-r--r-- | library/cpp/protobuf/util/sort.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/library/cpp/protobuf/util/sort.h b/library/cpp/protobuf/util/sort.h deleted file mode 100644 index 985ba6f689..0000000000 --- a/library/cpp/protobuf/util/sort.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include <google/protobuf/message.h> - -#include <util/generic/vector.h> -#include <util/generic/algorithm.h> - -namespace NProtoBuf { - // TComparePtr is something like: - // typedef bool (*TComparePtr)(const Message* msg1, const Message* msg2); - // typedef bool (*TComparePtr)(const TProto* msg1, const TProto* msg2); - - template <typename TProto, typename TComparePtr> - void SortMessages(RepeatedPtrField<TProto>& msgs, TComparePtr cmp) { - TVector<TProto*> ptrs; - ptrs.reserve(msgs.size()); - while (msgs.size()) { - ptrs.push_back(msgs.ReleaseLast()); - } - - ::StableSort(ptrs.begin(), ptrs.end(), cmp); - - for (size_t i = 0; i < ptrs.size(); ++i) { - msgs.AddAllocated(ptrs[i]); - } - } - -} |