aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/algorithm.h
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/generic/algorithm.h
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r--util/generic/algorithm.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h
index fce4c9c695..badfb88993 100644
--- a/util/generic/algorithm.h
+++ b/util/generic/algorithm.h
@@ -181,7 +181,7 @@ static inline bool AnyOf(const C& c, P pred) {
template <class I, class P>
static inline auto FindIfPtr(I f, I l, P pred) -> decltype(&*f) {
I found = FindIf(f, l, pred);
- return (found != l) ? &*found : nullptr;
+ return (found != l) ? &*found : nullptr;
}
template <class C, class P>
@@ -218,16 +218,16 @@ inline bool EqualToOneOf(const T& x, const U& y, const Other&... other) {
return x == y || EqualToOneOf(x, other...);
}
-template <typename T>
-static inline size_t CountOf(const T&) {
- return 0;
-}
-
-template <typename T, typename U, typename... Other>
-static inline size_t CountOf(const T& x, const U& y, const Other&... other) {
- return static_cast<size_t>(x == y) + CountOf(x, other...);
-}
-
+template <typename T>
+static inline size_t CountOf(const T&) {
+ return 0;
+}
+
+template <typename T, typename U, typename... Other>
+static inline size_t CountOf(const T& x, const U& y, const Other&... other) {
+ return static_cast<size_t>(x == y) + CountOf(x, other...);
+}
+
template <class I>
static inline void PushHeap(I f, I l) {
std::push_heap(f, l);
@@ -438,7 +438,7 @@ static inline void Fill(I f, I l, const T& v) {
std::fill(f, l, v);
}
-template <typename I, typename S, typename T>
+template <typename I, typename S, typename T>
static inline I FillN(I f, S n, const T& v) {
return std::fill_n(f, n, v);
}