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/bitvector.h | |
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/bitvector.h')
-rw-r--r-- | library/cpp/containers/bitseq/bitvector.h | 18 |
1 files changed, 9 insertions, 9 deletions
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) { |