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 | 01b069525b0643380d885e1549f9d1f1ecdfbb24 (patch) | |
tree | f857c21c9a7251b69e4a6898cc87c652895ce110 /util/generic/algorithm.h | |
parent | e81e6b392d3d3c42324819910b7af32119e85a11 (diff) | |
download | ydb-01b069525b0643380d885e1549f9d1f1ecdfbb24.tar.gz |
Restoring authorship annotation for <sukhoi@yandex-team.ru>. Commit 1 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 badfb88993..aa700a7c04 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); |