aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/bitseq
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit8cbc307de0221f84c80c42dcbe07d40727537e2c (patch)
tree625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/containers/bitseq
parent30d1ef3941e0dc835be7609de5ebee66958f215a (diff)
downloadydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/bitseq')
-rw-r--r--library/cpp/containers/bitseq/bititerator.h4
-rw-r--r--library/cpp/containers/bitseq/bititerator_ut.cpp10
-rw-r--r--library/cpp/containers/bitseq/bitvector.h12
-rw-r--r--library/cpp/containers/bitseq/bitvector_ut.cpp12
-rw-r--r--library/cpp/containers/bitseq/traits.h4
5 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/containers/bitseq/bititerator.h b/library/cpp/containers/bitseq/bititerator.h
index 52dadd3798..bbeadb7295 100644
--- a/library/cpp/containers/bitseq/bititerator.h
+++ b/library/cpp/containers/bitseq/bititerator.h
@@ -44,7 +44,7 @@ public:
TWord Peek(ui8 count) const {
if (!count)
return 0;
- Y_VERIFY_DEBUG(count <= TTraits::NumBits);
+ Y_VERIFY_DEBUG(count <= TTraits::NumBits);
if (!Mask)
return *Data & TTraits::ElemMask(count);
@@ -64,7 +64,7 @@ public:
TWord Read(ui8 count) {
if (!count)
return 0;
- Y_VERIFY_DEBUG(count <= TTraits::NumBits);
+ Y_VERIFY_DEBUG(count <= TTraits::NumBits);
if (!Mask) {
Current = *Data++;
diff --git a/library/cpp/containers/bitseq/bititerator_ut.cpp b/library/cpp/containers/bitseq/bititerator_ut.cpp
index ed0925866f..a7bbec119f 100644
--- a/library/cpp/containers/bitseq/bititerator_ut.cpp
+++ b/library/cpp/containers/bitseq/bititerator_ut.cpp
@@ -3,7 +3,7 @@
#include <library/cpp/testing/unittest/registar.h>
#include <util/generic/vector.h>
-Y_UNIT_TEST_SUITE(TBitIteratorTest) {
+Y_UNIT_TEST_SUITE(TBitIteratorTest) {
TVector<ui16> GenWords() {
TVector<ui16> words(1, 0);
for (ui16 word = 1; word; ++word)
@@ -19,7 +19,7 @@ Y_UNIT_TEST_SUITE(TBitIteratorTest) {
UNIT_ASSERT_EQUAL(peek, expected);
}
- Y_UNIT_TEST(TestNextAndPeek) {
+ Y_UNIT_TEST(TestNextAndPeek) {
const auto& words = GenWords();
TBitIterator<ui16> iter(words.data());
@@ -37,7 +37,7 @@ Y_UNIT_TEST_SUITE(TBitIteratorTest) {
UNIT_ASSERT_EQUAL(iter.NextWord(), words.data() + words.size());
}
- Y_UNIT_TEST(TestAlignedReadAndPeek) {
+ Y_UNIT_TEST(TestAlignedReadAndPeek) {
const auto& words = GenWords();
TBitIterator<ui16> iter(words.data());
@@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(TBitIteratorTest) {
UNIT_ASSERT_EQUAL(iter.NextWord(), words.data() + words.size());
}
- Y_UNIT_TEST(TestForward) {
+ Y_UNIT_TEST(TestForward) {
TVector<ui32> words;
words.push_back((1 << 10) | (1 << 20) | (1 << 25));
words.push_back(1 | (1 << 5) | (1 << 6) | (1 << 30));
@@ -89,7 +89,7 @@ Y_UNIT_TEST_SUITE(TBitIteratorTest) {
UNIT_ASSERT_EQUAL(iter.NextWord(), words.data() + 6);
}
- Y_UNIT_TEST(TestUnalignedReadAndPeek) {
+ Y_UNIT_TEST(TestUnalignedReadAndPeek) {
TVector<ui32> words;
words.push_back((1 << 10) | (1 << 20) | (1 << 25));
words.push_back(1 | (1 << 5) | (1 << 6) | (1 << 30));
diff --git a/library/cpp/containers/bitseq/bitvector.h b/library/cpp/containers/bitseq/bitvector.h
index 3f8fd81ee5..9d6471ea9a 100644
--- a/library/cpp/containers/bitseq/bitvector.h
+++ b/library/cpp/containers/bitseq/bitvector.h
@@ -52,7 +52,7 @@ public:
}
bool Set(ui64 pos) {
- Y_ASSERT(pos < Size_);
+ Y_ASSERT(pos < Size_);
TWord& val = Data_[pos >> TTraits::DivShift];
if (val & TTraits::BitMask(pos & TTraits::ModMask))
return false;
@@ -65,7 +65,7 @@ public:
}
void Reset(ui64 pos) {
- Y_ASSERT(pos < Size_);
+ Y_ASSERT(pos < Size_);
Data_[pos >> TTraits::DivShift] &= ~TTraits::BitMask(pos & TTraits::ModMask);
}
@@ -80,7 +80,7 @@ public:
void Set(ui64 pos, TWord value, ui8 width, TWord mask) {
if (!width)
return;
- Y_ASSERT((pos + width) <= Size_);
+ Y_ASSERT((pos + width) <= Size_);
size_t word = pos >> TTraits::DivShift;
TWord shift1 = pos & TTraits::ModMask;
TWord shift2 = TTraits::NumBits - shift1;
@@ -130,12 +130,12 @@ public:
return Data_.data();
}
- void Save(IOutputStream* out) const {
+ void Save(IOutputStream* out) const {
::Save(out, Size_);
::Save(out, Data_);
}
- void Load(IInputStream* inp) {
+ void Load(IInputStream* inp) {
::Load(inp, Size_);
::Load(inp, Data_);
}
@@ -145,7 +145,7 @@ public:
Data_.size() * sizeof(TWord));
}
- void Print(IOutputStream& out, size_t truncate = 128) {
+ void Print(IOutputStream& out, size_t truncate = 128) {
for (size_t i = 0; i < Data_.size() && i < truncate; ++i) {
for (int j = TTraits::NumBits - 1; j >= 0; --j) {
size_t pos = TTraits::NumBits * i + j;
diff --git a/library/cpp/containers/bitseq/bitvector_ut.cpp b/library/cpp/containers/bitseq/bitvector_ut.cpp
index 6137adab1e..3fd4df1de6 100644
--- a/library/cpp/containers/bitseq/bitvector_ut.cpp
+++ b/library/cpp/containers/bitseq/bitvector_ut.cpp
@@ -6,8 +6,8 @@
#include <util/memory/blob.h>
#include <util/stream/buffer.h>
-Y_UNIT_TEST_SUITE(TBitVectorTest) {
- Y_UNIT_TEST(TestEmpty) {
+Y_UNIT_TEST_SUITE(TBitVectorTest) {
+ Y_UNIT_TEST(TestEmpty) {
TBitVector<ui64> v64;
UNIT_ASSERT_EQUAL(v64.Size(), 0);
UNIT_ASSERT_EQUAL(v64.Words(), 0);
@@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TBitVectorTest) {
UNIT_ASSERT_EQUAL(v32.Words(), 0);
}
- Y_UNIT_TEST(TestOneWord) {
+ Y_UNIT_TEST(TestOneWord) {
TBitVector<ui32> v;
v.Append(1, 1);
v.Append(0, 1);
@@ -42,7 +42,7 @@ Y_UNIT_TEST_SUITE(TBitVectorTest) {
UNIT_ASSERT_EQUAL(v.Words(), 1);
}
- Y_UNIT_TEST(TestManyWords) {
+ Y_UNIT_TEST(TestManyWords) {
static const int BITS = 10;
TBitVector<ui64> v;
@@ -55,7 +55,7 @@ Y_UNIT_TEST_SUITE(TBitVectorTest) {
UNIT_ASSERT_EQUAL(v.Get(i * BITS, BITS), (ui64)i);
}
- Y_UNIT_TEST(TestMaxWordSize) {
+ Y_UNIT_TEST(TestMaxWordSize) {
TBitVector<ui32> v;
for (int i = 0; i < 100; ++i)
v.Append(i, 32);
@@ -67,7 +67,7 @@ Y_UNIT_TEST_SUITE(TBitVectorTest) {
UNIT_ASSERT_EQUAL(v.Get(10 * 32, 32), 100500);
}
- Y_UNIT_TEST(TestReadonlyVector) {
+ Y_UNIT_TEST(TestReadonlyVector) {
TBitVector<ui64> v(100);
for (ui64 i = 0; i < v.Size(); ++i) {
if (i % 3 == 0) {
diff --git a/library/cpp/containers/bitseq/traits.h b/library/cpp/containers/bitseq/traits.h
index 2330b1b4f2..a57f15d7b3 100644
--- a/library/cpp/containers/bitseq/traits.h
+++ b/library/cpp/containers/bitseq/traits.h
@@ -1,6 +1,6 @@
#pragma once
-#include <util/generic/bitops.h>
+#include <util/generic/bitops.h>
#include <util/generic/typetraits.h>
#include <util/system/yassert.h>
@@ -12,7 +12,7 @@ struct TBitSeqTraits {
static inline TWord ElemMask(ui8 count) {
// NOTE: Shifting by the type's length is UB, so we need this workaround.
- if (Y_LIKELY(count))
+ if (Y_LIKELY(count))
return TWord(-1) >> (NumBits - count);
return 0;
}