diff options
author | sukhoi <sukhoi@yandex-team.ru> | 2022-02-10 16:51:35 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:35 +0300 |
commit | 31b383c710ee84e3470e22bcb85863a46acd951b (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/algorithm.h | |
parent | 01b069525b0643380d885e1549f9d1f1ecdfbb24 (diff) | |
download | ydb-31b383c710ee84e3470e22bcb85863a46acd951b.tar.gz |
Restoring authorship annotation for <sukhoi@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r-- | util/generic/algorithm.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h index aa700a7c04..badfb88993 100644 --- a/util/generic/algorithm.h +++ b/util/generic/algorithm.h @@ -313,18 +313,18 @@ static inline T UniqueBy(T f, T l, const TGetKey& getKey) { return Unique(f, l, [&](auto&& left, auto&& right) { return getKey(left) == getKey(right); }); } -template <class C> -void SortUnique(C& c) { - Sort(c.begin(), c.end()); +template <class C> +void SortUnique(C& c) { + Sort(c.begin(), c.end()); c.erase(Unique(c.begin(), c.end()), c.end()); -} - -template <class C, class Cmp> -void SortUnique(C& c, Cmp cmp) { - Sort(c.begin(), c.end(), cmp); +} + +template <class C, class Cmp> +void SortUnique(C& c, Cmp cmp) { + Sort(c.begin(), c.end(), cmp); c.erase(Unique(c.begin(), c.end()), c.end()); -} - +} + template <class C, class TGetKey> void SortUniqueBy(C& c, const TGetKey& getKey) { SortBy(c, getKey); |