diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/containers/bitseq | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/bitseq')
-rw-r--r-- | library/cpp/containers/bitseq/bititerator.h | 12 | ||||
-rw-r--r-- | library/cpp/containers/bitseq/bititerator_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/containers/bitseq/bitvector.cpp | 2 | ||||
-rw-r--r-- | library/cpp/containers/bitseq/bitvector.h | 18 | ||||
-rw-r--r-- | library/cpp/containers/bitseq/readonly_bitvector.h | 4 | ||||
-rw-r--r-- | library/cpp/containers/bitseq/ya.make | 16 |
6 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/containers/bitseq/bititerator.h b/library/cpp/containers/bitseq/bititerator.h index 6eeaec4073..52dadd3798 100644 --- a/library/cpp/containers/bitseq/bititerator.h +++ b/library/cpp/containers/bitseq/bititerator.h @@ -3,7 +3,7 @@ #include "traits.h" #include <library/cpp/pop_count/popcount.h> - + template <typename T> class TBitIterator { public: @@ -15,8 +15,8 @@ public: : Current(0) , Mask(0) , Data(data) - { - } + { + } /// Get the word next to the one we are currenlty iterating over. const TWord* NextWord() const { @@ -49,7 +49,7 @@ public: if (!Mask) return *Data & TTraits::ElemMask(count); - auto usedBits = (size_t)PopCount(Mask - 1); + auto usedBits = (size_t)PopCount(Mask - 1); TWord result = Current >> usedBits; auto leftInCurrent = TTraits::NumBits - usedBits; if (count <= leftInCurrent) @@ -72,7 +72,7 @@ public: return Current & TTraits::ElemMask(count); } - auto usedBits = (size_t)PopCount(Mask - 1); + auto usedBits = (size_t)PopCount(Mask - 1); TWord result = Current >> usedBits; auto leftInCurrent = TTraits::NumBits - usedBits; if (count < leftInCurrent) { @@ -97,7 +97,7 @@ public: if (!count) return; - int leftInCurrent = (size_t)PopCount(~(Mask - 1)); + int leftInCurrent = (size_t)PopCount(~(Mask - 1)); if (count < leftInCurrent) { Mask <<= count; return; diff --git a/library/cpp/containers/bitseq/bititerator_ut.cpp b/library/cpp/containers/bitseq/bititerator_ut.cpp index e5aa5a9184..ed0925866f 100644 --- a/library/cpp/containers/bitseq/bititerator_ut.cpp +++ b/library/cpp/containers/bitseq/bititerator_ut.cpp @@ -12,7 +12,7 @@ Y_UNIT_TEST_SUITE(TBitIteratorTest) { } template <typename TWord> - void AssertPeekRead(TBitIterator<TWord> & iter, ui8 count, TWord expected) { + void AssertPeekRead(TBitIterator<TWord> & iter, ui8 count, TWord expected) { auto peek = iter.Peek(count); auto read = iter.Read(count); UNIT_ASSERT_EQUAL(peek, read); diff --git a/library/cpp/containers/bitseq/bitvector.cpp b/library/cpp/containers/bitseq/bitvector.cpp index 895baeb99b..05cb3a881d 100644 --- a/library/cpp/containers/bitseq/bitvector.cpp +++ b/library/cpp/containers/bitseq/bitvector.cpp @@ -1 +1 @@ -#include "bitvector.h" +#include "bitvector.h" diff --git a/library/cpp/containers/bitseq/bitvector.h b/library/cpp/containers/bitseq/bitvector.h index e5d171a203..3f8fd81ee5 100644 --- a/library/cpp/containers/bitseq/bitvector.h +++ b/library/cpp/containers/bitseq/bitvector.h @@ -3,7 +3,7 @@ #include "traits.h" #include <library/cpp/pop_count/popcount.h> - + #include <util/generic/vector.h> #include <util/ysaveload.h> @@ -78,8 +78,8 @@ public: } void Set(ui64 pos, TWord value, ui8 width, TWord mask) { - if (!width) - return; + if (!width) + return; Y_ASSERT((pos + width) <= Size_); size_t word = pos >> TTraits::DivShift; TWord shift1 = pos & TTraits::ModMask; @@ -87,8 +87,8 @@ public: Data_[word] &= ~(mask << shift1); Data_[word] |= (value & mask) << shift1; if (shift2 < width) { - Data_[word + 1] &= ~(mask >> shift2); - Data_[word + 1] |= (value & mask) >> shift2; + Data_[word + 1] &= ~(mask >> shift2); + Data_[word + 1] |= (value & mask) >> shift2; } } @@ -97,8 +97,8 @@ public: } void Append(TWord value, ui8 width, TWord mask) { - if (!width) - return; + if (!width) + return; if (Data_.size() * TTraits::NumBits < Size_ + width) { Data_.push_back(0); } @@ -113,7 +113,7 @@ public: size_t Count() const { size_t count = 0; for (size_t i = 0; i < Data_.size(); ++i) { - count += (size_t)PopCount(Data_[i]); + count += (size_t)PopCount(Data_[i]); } return count; } @@ -142,7 +142,7 @@ public: ui64 Space() const { return CHAR_BIT * (sizeof(Size_) + - Data_.size() * sizeof(TWord)); + Data_.size() * sizeof(TWord)); } void Print(IOutputStream& out, size_t truncate = 128) { diff --git a/library/cpp/containers/bitseq/readonly_bitvector.h b/library/cpp/containers/bitseq/readonly_bitvector.h index 419e49811e..8612739c3f 100644 --- a/library/cpp/containers/bitseq/readonly_bitvector.h +++ b/library/cpp/containers/bitseq/readonly_bitvector.h @@ -16,8 +16,8 @@ public: TReadonlyBitVector() : Size_() , Data_() - { - } + { + } explicit TReadonlyBitVector(const TBitVector<T>& vector) : Size_(vector.Size_) diff --git a/library/cpp/containers/bitseq/ya.make b/library/cpp/containers/bitseq/ya.make index 758e2bec77..7090956c55 100644 --- a/library/cpp/containers/bitseq/ya.make +++ b/library/cpp/containers/bitseq/ya.make @@ -2,14 +2,14 @@ LIBRARY() OWNER(g:util) -PEERDIR( - util/draft +PEERDIR( + util/draft library/cpp/pop_count -) - -SRCS( - bitvector.cpp +) + +SRCS( + bitvector.cpp readonly_bitvector.cpp -) - +) + END() |