diff options
author | agorodilov <agorodilov@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
commit | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (patch) | |
tree | 9e9943579e5a14679af7cd2cda3c36d8c0b775d3 /util/generic | |
parent | 676340c42e269f3070f194d160f42a83a10568d4 (diff) | |
download | ydb-7a4979e6211c3e78c7f9041d4a9e5d3405343c36.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r-- | util/generic/bitmap.h | 8 | ||||
-rw-r--r-- | util/generic/bitops.h | 16 | ||||
-rw-r--r-- | util/generic/bitops_ut.cpp | 2 | ||||
-rw-r--r-- | util/generic/cast_ut.cpp | 2 | ||||
-rw-r--r-- | util/generic/flags_ut.cpp | 4 | ||||
-rw-r--r-- | util/generic/hash.h | 12 | ||||
-rw-r--r-- | util/generic/intrlist.h | 8 | ||||
-rw-r--r-- | util/generic/maybe.h | 4 | ||||
-rw-r--r-- | util/generic/ptr.cpp | 2 | ||||
-rw-r--r-- | util/generic/ptr.h | 12 | ||||
-rw-r--r-- | util/generic/ptr_ut.cpp | 4 | ||||
-rw-r--r-- | util/generic/refcount.h | 2 | ||||
-rw-r--r-- | util/generic/utility.h | 4 |
13 files changed, 40 insertions, 40 deletions
diff --git a/util/generic/bitmap.h b/util/generic/bitmap.h index f77d182460..e0b3f0cd4a 100644 --- a/util/generic/bitmap.h +++ b/util/generic/bitmap.h @@ -347,7 +347,7 @@ public: } public: - ~TReference() = default; + ~TReference() = default; Y_FORCE_INLINE TReference& operator=(bool val) { if (val) @@ -416,14 +416,14 @@ private: } public: - TBitMapOps() = default; + TBitMapOps() = default; TBitMapOps(TChunk val) { Mask.Data[0] = val; Mask.Sanitize(); } - TBitMapOps(const TThis&) = default; + TBitMapOps(const TThis&) = default; template <class T> TBitMapOps(const TBitMapOps<T>& bitmap) @@ -1093,7 +1093,7 @@ public: { } - TBitMap(const TBitMap<BitCount, TChunkType>&) = default; + TBitMap(const TBitMap<BitCount, TChunkType>&) = default; template <class T> TBitMap(const TBitMapOps<T>& bitmap) diff --git a/util/generic/bitops.h b/util/generic/bitops.h index 2db15fc59b..bc4b5e5bbe 100644 --- a/util/generic/bitops.h +++ b/util/generic/bitops.h @@ -310,14 +310,14 @@ Y_FORCE_INLINE ui64 LeastSignificantBit(ui64 v) { } /* - * Returns 0 - based position of the most significant bit (compile time) - * 0 for 0. - */ -constexpr ui64 MostSignificantBitCT(ui64 x) { - return x > 1 ? 1 + MostSignificantBitCT(x >> 1) : 0; -} - -/* + * Returns 0 - based position of the most significant bit (compile time) + * 0 for 0. + */ +constexpr ui64 MostSignificantBitCT(ui64 x) { + return x > 1 ? 1 + MostSignificantBitCT(x >> 1) : 0; +} + +/* * Return rounded up binary logarithm of `x`. */ Y_FORCE_INLINE ui8 CeilLog2(ui64 x) { diff --git a/util/generic/bitops_ut.cpp b/util/generic/bitops_ut.cpp index d23c2b5c27..5a4fc0b433 100644 --- a/util/generic/bitops_ut.cpp +++ b/util/generic/bitops_ut.cpp @@ -85,7 +85,7 @@ Y_UNIT_TEST_SUITE(TBitOpsTest) { static_assert(MostSignificantBitCT(0) == 0, "."); static_assert(MostSignificantBitCT(1) == 0, "."); static_assert(MostSignificantBitCT(5) == 2, "."); - + for (ui32 i = 0; i < 64; ++i) { UNIT_ASSERT_VALUES_EQUAL(i, MostSignificantBit(ui64{1} << i)); } diff --git a/util/generic/cast_ut.cpp b/util/generic/cast_ut.cpp index 718a8de79d..2c759a561b 100644 --- a/util/generic/cast_ut.cpp +++ b/util/generic/cast_ut.cpp @@ -13,7 +13,7 @@ class TGenericCastsTest: public TTestBase { private: struct TAaa { - virtual ~TAaa() = default; + virtual ~TAaa() = default; }; struct TBbb: public TAaa {}; diff --git a/util/generic/flags_ut.cpp b/util/generic/flags_ut.cpp index 5377c6a058..63dacffab3 100644 --- a/util/generic/flags_ut.cpp +++ b/util/generic/flags_ut.cpp @@ -83,7 +83,7 @@ Y_UNIT_TEST_SUITE(TFlagsTest) { } Y_UNIT_TEST(TestOutput) { - ETest1 value0 = nullptr, value1 = Test1, value7 = Test1 | Test2 | Test4; + ETest1 value0 = nullptr, value1 = Test1, value7 = Test1 | Test2 | Test4; UNIT_ASSERT_VALUES_EQUAL(ToString(value0), "TFlags(0000000000000000)"); UNIT_ASSERT_VALUES_EQUAL(ToString(value1), "TFlags(0000000000000001)"); @@ -91,7 +91,7 @@ Y_UNIT_TEST_SUITE(TFlagsTest) { } Y_UNIT_TEST(TestHash) { - ETest1 value0 = nullptr, value1 = Test1; + ETest1 value0 = nullptr, value1 = Test1; THashMap<ETest1, int> hash; hash[value0] = 0; diff --git a/util/generic/hash.h b/util/generic/hash.h index e46db21fa9..33fff78e08 100644 --- a/util/generic/hash.h +++ b/util/generic/hash.h @@ -97,7 +97,7 @@ struct __yhashtable_iterator { return !cur; } Y_FORCE_INLINE explicit operator bool() const noexcept { - return cur != nullptr; + return cur != nullptr; } }; @@ -144,7 +144,7 @@ struct __yhashtable_const_iterator { return !cur; } Y_FORCE_INLINE explicit operator bool() const noexcept { - return cur != nullptr; + return cur != nullptr; } }; @@ -1242,9 +1242,9 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase(iterator first, iterator last) { else if (f_bucket == l_bucket) erase_bucket(f_bucket, first.cur, last.cur); else { - erase_bucket(f_bucket, first.cur, nullptr); + erase_bucket(f_bucket, first.cur, nullptr); for (size_type n = f_bucket + 1; n < l_bucket; ++n) - erase_bucket(n, nullptr); + erase_bucket(n, nullptr); if (l_bucket != buckets.size()) /*y*/ erase_bucket(l_bucket, last.cur); } @@ -1322,7 +1322,7 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase_bucket(const size_type n, node* firs while (next != last) { /*y; 3.1*/ cur->next = next->next; delete_node(next); - next = ((uintptr_t)cur->next & 1) ? nullptr : cur->next; /*y*/ + next = ((uintptr_t)cur->next & 1) ? nullptr : cur->next; /*y*/ --num_elements; } } @@ -1334,7 +1334,7 @@ void THashTable<V, K, HF, Ex, Eq, A>::erase_bucket(const size_type n, node* last while (cur != last) { node* next = cur->next; delete_node(cur); - cur = ((uintptr_t)next & 1) ? nullptr : next; /*y*/ + cur = ((uintptr_t)next & 1) ? nullptr : next; /*y*/ buckets[n] = cur; --num_elements; } diff --git a/util/generic/intrlist.h b/util/generic/intrlist.h index b5d3f2051b..e8c17df072 100644 --- a/util/generic/intrlist.h +++ b/util/generic/intrlist.h @@ -229,7 +229,7 @@ private: using reference = typename TIterator::reference; using pointer = typename TIterator::pointer; - inline TReverseIteratorBase() noexcept = default; + inline TReverseIteratorBase() noexcept = default; template <class TIterator_> inline TReverseIteratorBase(const TReverseIteratorBase<TIterator_>& right) noexcept @@ -340,7 +340,7 @@ public: } public: - inline TIntrusiveList() noexcept = default; + inline TIntrusiveList() noexcept = default; inline ~TIntrusiveList() = default; @@ -600,7 +600,7 @@ public: using const_reverse_iterator = TConstReverseIterator; public: - inline TIntrusiveListWithAutoDelete() noexcept = default; + inline TIntrusiveListWithAutoDelete() noexcept = default; inline TIntrusiveListWithAutoDelete(TIntrusiveListWithAutoDelete&& right) noexcept : TIntrusiveList<T, Tag>(std::move(right)) @@ -647,7 +647,7 @@ public: { } - inline ~TIntrusiveSListItem() = default; + inline ~TIntrusiveSListItem() = default; inline bool IsEnd() const noexcept { return Next_ == nullptr; diff --git a/util/generic/maybe.h b/util/generic/maybe.h index 34d21aebcd..ae06f836e5 100644 --- a/util/generic/maybe.h +++ b/util/generic/maybe.h @@ -306,11 +306,11 @@ public: } const T* Get() const noexcept { - return Defined() ? Data() : nullptr; + return Defined() ? Data() : nullptr; } T* Get() noexcept { - return Defined() ? Data() : nullptr; + return Defined() ? Data() : nullptr; } constexpr const T& GetRef() const& { diff --git a/util/generic/ptr.cpp b/util/generic/ptr.cpp index b29baebc17..3109929a21 100644 --- a/util/generic/ptr.cpp +++ b/util/generic/ptr.cpp @@ -14,4 +14,4 @@ void TDelete::Destroy(void* t) noexcept { ::operator delete(t); } -TThrRefBase::~TThrRefBase() = default; +TThrRefBase::~TThrRefBase() = default; diff --git a/util/generic/ptr.h b/util/generic/ptr.h index 19db0e3ec5..21b2e3cecb 100644 --- a/util/generic/ptr.h +++ b/util/generic/ptr.h @@ -201,7 +201,7 @@ public: } inline void Destroy() noexcept { - Reset(nullptr); + Reset(nullptr); } inline void Swap(TAutoPtr& r) noexcept { @@ -363,7 +363,7 @@ public: { } - inline ~TRefCounted() = default; + inline ~TRefCounted() = default; inline void Ref(TAtomicBase d) noexcept { auto resultCount = Counter_.Add(d); @@ -563,14 +563,14 @@ public: } inline void Drop() noexcept { - TIntrusivePtr(nullptr).Swap(*this); + TIntrusivePtr(nullptr).Swap(*this); } inline T* Release() const noexcept Y_WARN_UNUSED_RESULT { T* res = T_; if (T_) { Ops::DecRef(T_); - T_ = nullptr; + T_ = nullptr; } return res; } @@ -745,7 +745,7 @@ public: InitStaticOps(); } - inline ~TSimpleIntrusiveOps() = default; + inline ~TSimpleIntrusiveOps() = default; static inline void Ref(T* t) noexcept { Ref_(t); @@ -1060,7 +1060,7 @@ class TCowPtr: public TPointerBase<TCowPtr<TPtr, TCopy>, const typename TPtr::TV using T = typename TPtr::TValueType; public: - inline TCowPtr() = default; + inline TCowPtr() = default; inline TCowPtr(const TPtr& p) : T_(p) diff --git a/util/generic/ptr_ut.cpp b/util/generic/ptr_ut.cpp index c2dcff23f6..68469ee10f 100644 --- a/util/generic/ptr_ut.cpp +++ b/util/generic/ptr_ut.cpp @@ -166,7 +166,7 @@ void TPointerTest::TestHolderPtrMoveAssignment() { } struct TBase { - virtual ~TBase() = default; + virtual ~TBase() = default; }; struct TDerived: public TBase { @@ -319,7 +319,7 @@ public: { ++Cnt; } - ~TOp2() override { + ~TOp2() override { --Cnt; } }; diff --git a/util/generic/refcount.h b/util/generic/refcount.h index 966e853b77..659c07873d 100644 --- a/util/generic/refcount.h +++ b/util/generic/refcount.h @@ -107,7 +107,7 @@ public: { } - inline ~TAtomicCounter() = default; + inline ~TAtomicCounter() = default; inline TAtomicBase Add(TAtomicBase d) noexcept { return AtomicAdd(Counter_, d); diff --git a/util/generic/utility.h b/util/generic/utility.h index 43b98eeafc..37a87e222b 100644 --- a/util/generic/utility.h +++ b/util/generic/utility.h @@ -24,7 +24,7 @@ static constexpr const T& Max(const T& a, const T& b, const Args&... args) { return Max(a, Max(b, args...)); } -// replace with http://en.cppreference.com/w/cpp/algorithm/clamp in c++17 +// replace with http://en.cppreference.com/w/cpp/algorithm/clamp in c++17 template <class T> constexpr const T& ClampVal(const T& val, const T& min, const T& max) { return val < min ? min : (max < val ? max : val); @@ -44,7 +44,7 @@ static T Mean(const Args&... other) noexcept { template <class T> static inline void Zero(T& t) noexcept { - memset((void*)&t, 0, sizeof(t)); + memset((void*)&t, 0, sizeof(t)); } /** |