aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/bitops.h
diff options
context:
space:
mode:
authorIlnur Khuziev <ilnur.khuziev@yandex.ru>2022-02-10 16:46:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:14 +0300
commit60040c91ffe701a84689b2c6310ff845e65cff42 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/bitops.h
parent736dcd8ca259457a136f2f9f9168c44643914323 (diff)
downloadydb-60040c91ffe701a84689b2c6310ff845e65cff42.tar.gz
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/bitops.h')
-rw-r--r--util/generic/bitops.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/generic/bitops.h b/util/generic/bitops.h
index 0de23f0be9..2db15fc59b 100644
--- a/util/generic/bitops.h
+++ b/util/generic/bitops.h
@@ -430,8 +430,8 @@ constexpr T RotateBitsRightCT(T value, const ui8 shift) noexcept {
*/
template <size_t Offset, size_t Size, class T>
Y_FORCE_INLINE T SelectBits(T value) {
- static_assert(Size < sizeof(T) * 8, "violated: Size < sizeof(T) * 8");
- static_assert(Offset < sizeof(T) * 8, "violated: Offset < sizeof(T) * 8");
+ static_assert(Size < sizeof(T) * 8, "violated: Size < sizeof(T) * 8");
+ static_assert(Offset < sizeof(T) * 8, "violated: Offset < sizeof(T) * 8");
T id = 1;
return (value >> Offset) & ((id << Size) - id);
}
@@ -441,8 +441,8 @@ Y_FORCE_INLINE T SelectBits(T value) {
*/
template <size_t Offset, size_t Size, class T>
void SetBits(T& value, T bits) {
- static_assert(Size < sizeof(T) * 8, "violated: Size < sizeof(T) * 8");
- static_assert(Offset < sizeof(T) * 8, "violated: Offset < sizeof(T) * 8");
+ static_assert(Size < sizeof(T) * 8, "violated: Size < sizeof(T) * 8");
+ static_assert(Offset < sizeof(T) * 8, "violated: Offset < sizeof(T) * 8");
T id = 1;
T maxValue = ((id << Size) - id);
Y_ASSERT(bits <= maxValue);