diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/containers/bitseq | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 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 52dadd3798..6eeaec4073 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 ed0925866f..e5aa5a9184 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 05cb3a881d..895baeb99b 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 3f8fd81ee5..e5d171a203 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 8612739c3f..419e49811e 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 7090956c55..758e2bec77 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() |