aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/algorithm.h
diff options
context:
space:
mode:
authorMikhail Borisov <borisov.mikhail@gmail.com>2022-02-10 16:45:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:40 +0300
commit5d50718e66d9c037dc587a0211110b7d25a66185 (patch)
treee98df59de24d2ef7c77baed9f41e4875a2fef972 /util/generic/algorithm.h
parenta6a92afe03e02795227d2641b49819b687f088f8 (diff)
downloadydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r--util/generic/algorithm.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h
index 821ba709d0..badfb88993 100644
--- a/util/generic/algorithm.h
+++ b/util/generic/algorithm.h
@@ -73,16 +73,16 @@ static inline void StableSort(T f, T l, C c) {
std::stable_sort(f, l, c);
}
-template <class TContainer>
-static inline void StableSort(TContainer& container) {
- StableSort(container.begin(), container.end());
-}
-
-template <class TContainer, typename TCompare>
-static inline void StableSort(TContainer& container, TCompare compare) {
- StableSort(container.begin(), container.end(), compare);
-}
-
+template <class TContainer>
+static inline void StableSort(TContainer& container) {
+ StableSort(container.begin(), container.end());
+}
+
+template <class TContainer, typename TCompare>
+static inline void StableSort(TContainer& container, TCompare compare) {
+ StableSort(container.begin(), container.end(), compare);
+}
+
template <class TIterator, typename TGetKey>
static inline void StableSortBy(TIterator begin, TIterator end, const TGetKey& getKey) {
StableSort(begin, end, [&](auto&& left, auto&& right) { return getKey(left) < getKey(right); });
@@ -278,11 +278,11 @@ static inline I LowerBound(I f, I l, const T& v, C c) {
return std::lower_bound(f, l, v, c);
}
-template <class I, class T, class TGetKey>
-static inline I LowerBoundBy(I f, I l, const T& v, const TGetKey& getKey) {
- return std::lower_bound(f, l, v, [&](auto&& left, auto&& right) { return getKey(left) < right; });
-}
-
+template <class I, class T, class TGetKey>
+static inline I LowerBoundBy(I f, I l, const T& v, const TGetKey& getKey) {
+ return std::lower_bound(f, l, v, [&](auto&& left, auto&& right) { return getKey(left) < right; });
+}
+
template <class I, class T>
static inline I UpperBound(I f, I l, const T& v) {
return std::upper_bound(f, l, v);
@@ -293,11 +293,11 @@ static inline I UpperBound(I f, I l, const T& v, C c) {
return std::upper_bound(f, l, v, c);
}
-template <class I, class T, class TGetKey>
-static inline I UpperBoundBy(I f, I l, const T& v, const TGetKey& getKey) {
- return std::upper_bound(f, l, v, [&](auto&& left, auto&& right) { return left < getKey(right); });
-}
-
+template <class I, class T, class TGetKey>
+static inline I UpperBoundBy(I f, I l, const T& v, const TGetKey& getKey) {
+ return std::upper_bound(f, l, v, [&](auto&& left, auto&& right) { return left < getKey(right); });
+}
+
template <class T>
static inline T Unique(T f, T l) {
return std::unique(f, l);