aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic
diff options
context:
space:
mode:
authorgerich <gerich@yandex-team.ru>2022-02-10 16:52:07 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:52:07 +0300
commit69d77def656f0edd1eead9f5a73940233255e5db (patch)
treeab7fbbf3253d4c0e2793218f09378908beb025fb /util/generic
parent7e04cc6298e4641e41f046bfb2cfd9b3020cd1cf (diff)
downloadydb-69d77def656f0edd1eead9f5a73940233255e5db.tar.gz
Restoring authorship annotation for <gerich@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r--util/generic/algorithm.h20
-rw-r--r--util/generic/algorithm_ut.cpp20
2 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h
index 26b07ea2d8..badfb88993 100644
--- a/util/generic/algorithm.h
+++ b/util/generic/algorithm.h
@@ -524,11 +524,11 @@ I MaxElementBy(I begin, I end, F&& func) {
}
template <class C, class F>
-auto MaxElementBy(C& c, F&& func) {
- return MaxElementBy(std::begin(c), std::end(c), std::forward<F>(func));
-}
-
-template <class C, class F>
+auto MaxElementBy(C& c, F&& func) {
+ return MaxElementBy(std::begin(c), std::end(c), std::forward<F>(func));
+}
+
+template <class C, class F>
auto MaxElementBy(const C& c, F&& func) {
return MaxElementBy(std::begin(c), std::end(c), std::forward<F>(func));
}
@@ -540,11 +540,11 @@ I MinElementBy(I begin, I end, F&& func) {
}
template <class C, class F>
-auto MinElementBy(C& c, F&& func) {
- return MinElementBy(std::begin(c), std::end(c), std::forward<F>(func));
-}
-
-template <class C, class F>
+auto MinElementBy(C& c, F&& func) {
+ return MinElementBy(std::begin(c), std::end(c), std::forward<F>(func));
+}
+
+template <class C, class F>
auto MinElementBy(const C& c, F&& func) {
return MinElementBy(std::begin(c), std::end(c), std::forward<F>(func));
}
diff --git a/util/generic/algorithm_ut.cpp b/util/generic/algorithm_ut.cpp
index 2de5183a27..8d732fcc0c 100644
--- a/util/generic/algorithm_ut.cpp
+++ b/util/generic/algorithm_ut.cpp
@@ -623,11 +623,11 @@ Y_UNIT_TEST_SUITE(TAlgorithm) {
return -1.0 * x;
}), 1);
- int arrayMutable[] = {1, 2, 5, 3, 4, 5};
- auto maxPtr = MaxElementBy(arrayMutable, [](int x) { return x; });
- *maxPtr += 100;
- UNIT_ASSERT_VALUES_EQUAL(*maxPtr, 105);
-
+ int arrayMutable[] = {1, 2, 5, 3, 4, 5};
+ auto maxPtr = MaxElementBy(arrayMutable, [](int x) { return x; });
+ *maxPtr += 100;
+ UNIT_ASSERT_VALUES_EQUAL(*maxPtr, 105);
+
auto identity = [](char x) {
return x;
};
@@ -649,11 +649,11 @@ Y_UNIT_TEST_SUITE(TAlgorithm) {
return -x;
}), 5);
- int arrayMutable[] = {1, 2, 5, 3, 4, 5};
- auto minPtr = MinElementBy(arrayMutable, [](int x) { return x; });
- *minPtr += 100;
- UNIT_ASSERT_VALUES_EQUAL(*minPtr, 101);
-
+ int arrayMutable[] = {1, 2, 5, 3, 4, 5};
+ auto minPtr = MinElementBy(arrayMutable, [](int x) { return x; });
+ *minPtr += 100;
+ UNIT_ASSERT_VALUES_EQUAL(*minPtr, 101);
+
auto identity = [](char x) {
return x;
};