diff options
author | jimmy <jimmy@yandex-team.ru> | 2022-02-10 16:49:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:38 +0300 |
commit | 5ab412f19b9312abbfa362391df45d6603bb84c3 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic | |
parent | affdafdb1fc09bf0bfc384355143ee6db9e90046 (diff) | |
download | ydb-5ab412f19b9312abbfa362391df45d6603bb84c3.tar.gz |
Restoring authorship annotation for <jimmy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r-- | util/generic/bitops.h | 4 | ||||
-rw-r--r-- | util/generic/bitops_ut.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/util/generic/bitops.h b/util/generic/bitops.h index e4ff0a1a852..2db15fc59b6 100644 --- a/util/generic/bitops.h +++ b/util/generic/bitops.h @@ -93,7 +93,7 @@ namespace NBitOps { Y_ASSERT(value); // because __builtin_ctz* have undefined result for zero. return __builtin_ctz(value); } - + inline unsigned CountTrailingZeroBitsImpl(unsigned long value) noexcept { Y_ASSERT(value); // because __builtin_ctz* have undefined result for zero. return __builtin_ctzl(value); @@ -211,7 +211,7 @@ static inline T FastClp2(T t) noexcept { using TCvt = typename ::TUnsignedInts::template TSelectBy<TSizeOfPredicate<sizeof(T)>::template TResult>::type; return 1 + ::NBitOps::NPrivate::TClp2Helper<sizeof(TCvt) * 4, T>::Calc(static_cast<TCvt>(t)); } - + /** * Check if integer is a power of 2. */ diff --git a/util/generic/bitops_ut.cpp b/util/generic/bitops_ut.cpp index 96c3a61ab8b..d23c2b5c27e 100644 --- a/util/generic/bitops_ut.cpp +++ b/util/generic/bitops_ut.cpp @@ -1,7 +1,7 @@ -#include "bitops.h" - +#include "bitops.h" + #include <library/cpp/testing/unittest/registar.h> - + #include <util/string/builder.h> template <typename T> @@ -46,11 +46,11 @@ static T ReverseBitsSlow(T v) { // DO_NOT_STYLE Y_UNIT_TEST_SUITE(TBitOpsTest) { Y_UNIT_TEST(TestCountTrailingZeroBits) { - TestCTZ<unsigned int>(); + TestCTZ<unsigned int>(); TestCTZ<unsigned long>(); TestCTZ<unsigned long long>(); } - + Y_UNIT_TEST(TestIsPowerOf2) { UNIT_ASSERT(!IsPowerOf2(-2)); UNIT_ASSERT(!IsPowerOf2(-1)); |