diff options
| author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:15 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:15 +0300 | 
| commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
| tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/containers/bitseq/bitvector.h | |
| parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 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 3f8fd81ee57..e5d171a203c 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) { | 
