diff options
author | divankov <divankov@yandex-team.ru> | 2022-02-10 16:48:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:05 +0300 |
commit | cd88d7933255d8690da34c7b1f7427cf2bb3ae23 (patch) | |
tree | 39e40694c8b41674a17b90f034e31d7cfcf20142 /util | |
parent | 37a2795395ba606e239b750ff2afb17905274ec4 (diff) | |
download | ydb-cd88d7933255d8690da34c7b1f7427cf2bb3ae23.tar.gz |
Restoring authorship annotation for <divankov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/datetime/base.h | 2 | ||||
-rw-r--r-- | util/generic/algorithm.h | 4 | ||||
-rw-r--r-- | util/generic/hash.h | 4 | ||||
-rw-r--r-- | util/generic/intrlist_ut.cpp | 4 | ||||
-rw-r--r-- | util/generic/strbase.h | 4 | ||||
-rw-r--r-- | util/system/nice.cpp | 28 | ||||
-rw-r--r-- | util/system/nice.h | 6 | ||||
-rw-r--r-- | util/system/nice_ut.cpp | 54 | ||||
-rw-r--r-- | util/system/tls.h | 2 |
9 files changed, 54 insertions, 54 deletions
diff --git a/util/datetime/base.h b/util/datetime/base.h index 5e902b8f63..f20ea05bb0 100644 --- a/util/datetime/base.h +++ b/util/datetime/base.h @@ -53,7 +53,7 @@ void sprint_gm_date(char* buf, time_t when, long* sec = nullptr); bool sscan_date(const char* date, struct tm& theTm); const int DATE_8601_LEN = 21; // strlen("YYYY-MM-DDThh:mm:ssZ") = 20 + '\0' - + size_t FormatDate8601(char* buf, size_t len, time_t when); inline void sprint_date8601(char* buf, time_t when) { diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h index badfb88993..54b6033a8c 100644 --- a/util/generic/algorithm.h +++ b/util/generic/algorithm.h @@ -63,7 +63,7 @@ static inline void SortBy(TContainer& container, const TGetKey& getKey) { SortBy(container.begin(), container.end(), getKey); } -template <class T> +template <class T> static inline void StableSort(T f, T l) { std::stable_sort(f, l); } @@ -93,7 +93,7 @@ static inline void StableSortBy(TContainer& container, const TGetKey& getKey) { StableSortBy(container.begin(), container.end(), getKey); } -template <class T> +template <class T> static inline void PartialSort(T f, T m, T l) { std::partial_sort(f, m, l); } diff --git a/util/generic/hash.h b/util/generic/hash.h index e46db21fa9..07632d686d 100644 --- a/util/generic/hash.h +++ b/util/generic/hash.h @@ -743,7 +743,7 @@ public: template <class ForwardIterator> void insert_unique(ForwardIterator f, ForwardIterator l, std::forward_iterator_tag) { difference_type n = std::distance(f, l); - + reserve(num_elements + n); for (; n > 0; --n, ++f) insert_unique_noresize(*f); @@ -752,7 +752,7 @@ public: template <class ForwardIterator> void insert_equal(ForwardIterator f, ForwardIterator l, std::forward_iterator_tag) { difference_type n = std::distance(f, l); - + reserve(num_elements + n); for (; n > 0; --n, ++f) emplace_equal_noresize(*f); diff --git a/util/generic/intrlist_ut.cpp b/util/generic/intrlist_ut.cpp index eff7cdf2ee..4972c03638 100644 --- a/util/generic/intrlist_ut.cpp +++ b/util/generic/intrlist_ut.cpp @@ -246,7 +246,7 @@ static void TestCutFront(int N, int M) { } TMyList::Cut(l.Begin(), it, l2.End()); - CheckIterationAfterCut(l2, l, N, M); + CheckIterationAfterCut(l2, l, N, M); } static void TestCutBack(int N, int M) { @@ -259,7 +259,7 @@ static void TestCutBack(int N, int M) { } TMyList::Cut(it, l.End(), l2.End()); - CheckIterationAfterCut(l, l2, N, M); + CheckIterationAfterCut(l, l2, N, M); } void TListTest::TestCut() { diff --git a/util/generic/strbase.h b/util/generic/strbase.h index ab39fc7537..44a514aa55 100644 --- a/util/generic/strbase.h +++ b/util/generic/strbase.h @@ -343,7 +343,7 @@ public: friend bool operator==(const TCharType* pc, const TSelf& s) noexcept { return equal(pc, s); } - + template <typename TDerived2, typename TTraits2> friend bool operator!=(const TSelf& s1, const TStringBase<TDerived2, TChar, TTraits2>& s2) noexcept { return !(s1 == s2); @@ -366,7 +366,7 @@ public: friend bool operator<(const TSelf& s1, const TStringBase<TDerived2, TChar, TTraits2>& s2) noexcept { return compare(s1, s2) < 0; } - + friend bool operator<(const TSelf& s1, TStringView s2) noexcept { return compare(s1, s2) < 0; } diff --git a/util/system/nice.cpp b/util/system/nice.cpp index 20fe926054..cbab07f688 100644 --- a/util/system/nice.cpp +++ b/util/system/nice.cpp @@ -1,15 +1,15 @@ -#include "nice.h" - -#include "platform.h" - -#if defined(_unix_) +#include "nice.h" + +#include "platform.h" + +#if defined(_unix_) #include <unistd.h> -#endif - -bool Nice(int prioDelta) { -#if defined(_unix_) - return nice(prioDelta) != -1; -#else - return prioDelta == 0; -#endif -} +#endif + +bool Nice(int prioDelta) { +#if defined(_unix_) + return nice(prioDelta) != -1; +#else + return prioDelta == 0; +#endif +} diff --git a/util/system/nice.h b/util/system/nice.h index 86b8bc5f3c..9d2e01331d 100644 --- a/util/system/nice.h +++ b/util/system/nice.h @@ -1,3 +1,3 @@ -#pragma once - -bool Nice(int prioDelta); +#pragma once + +bool Nice(int prioDelta); diff --git a/util/system/nice_ut.cpp b/util/system/nice_ut.cpp index ae0051f285..8650711def 100644 --- a/util/system/nice_ut.cpp +++ b/util/system/nice_ut.cpp @@ -1,42 +1,42 @@ -#include "nice.h" - -#include "platform.h" - +#include "nice.h" + +#include "platform.h" + #include <library/cpp/testing/unittest/registar.h> - -#ifdef _unix_ + +#ifdef _unix_ #include <sys/resource.h> - -static int GetPriority() { - return getpriority(PRIO_PROCESS, 0); -} -#endif - + +static int GetPriority() { + return getpriority(PRIO_PROCESS, 0); +} +#endif + Y_UNIT_TEST_SUITE(NiceTest) { Y_UNIT_TEST(TestNiceZero) { - UNIT_ASSERT(Nice(0)); - UNIT_ASSERT(Nice(0)); - } -#ifdef _unix_ + UNIT_ASSERT(Nice(0)); + UNIT_ASSERT(Nice(0)); + } +#ifdef _unix_ Y_UNIT_TEST(TestNice) { - int prio = GetPriority(); + int prio = GetPriority(); if (prio >= 10) { return; } - if (Nice(-2)) { - UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio - 2); - prio -= 2; - } else { - UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio); - } + if (Nice(-2)) { + UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio - 2); + prio -= 2; + } else { + UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio); + } UNIT_ASSERT(Nice(1)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 1); - UNIT_ASSERT(Nice(0)); + UNIT_ASSERT(Nice(0)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 1); UNIT_ASSERT(Nice(2)); UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 3); - } -#endif -} + } +#endif +} diff --git a/util/system/tls.h b/util/system/tls.h index 3c4f56dbeb..589a4effe9 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -235,7 +235,7 @@ namespace NTls { } inline operator const T&() const { - return Get(); + return Get(); } inline operator T&() { |