aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/bit_io/bitoutput.h
diff options
context:
space:
mode:
authorsolar <solar@yandex-team.ru>2022-02-10 16:49:59 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:59 +0300
commitda648cf6f097dd42d968802dca7734c68ef57d67 (patch)
tree7e2a3befe759a1ce261f51c2ef5bb3159257abed /library/cpp/bit_io/bitoutput.h
parentbee0f5f332db3abff5839ff24ac18000c161a30a (diff)
downloadydb-da648cf6f097dd42d968802dca7734c68ef57d67.tar.gz
Restoring authorship annotation for <solar@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/bit_io/bitoutput.h')
-rw-r--r--library/cpp/bit_io/bitoutput.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/bit_io/bitoutput.h b/library/cpp/bit_io/bitoutput.h
index 2b886c1f02..61f361b663 100644
--- a/library/cpp/bit_io/bitoutput.h
+++ b/library/cpp/bit_io/bitoutput.h
@@ -1,5 +1,5 @@
-#pragma once
-
+#pragma once
+
#include <library/cpp/deprecated/accessors/accessors.h>
#include <util/stream/output.h>
@@ -7,7 +7,7 @@
#include <util/generic/bitops.h>
#include <util/generic/vector.h>
#include <util/generic/yexception.h>
-
+
namespace NBitIO {
// Based on junk/solar/codecs/bitstream.h
@@ -34,7 +34,7 @@ namespace NBitIO {
, Offset()
{
}
-
+
ui64 GetOffset() const {
return Offset + BytesUp(64ULL - FreeBits);
}
@@ -49,13 +49,13 @@ namespace NBitIO {
public:
// interface
-
+
// Write "bits" lower bits.
Y_FORCE_INLINE void Write(ui64 data, ui64 bits) {
if (FreeBits < bits) {
if (FreeBits) {
bits -= FreeBits;
-
+
Active |= (data & MaskLowerBits(FreeBits)) << (64ULL - FreeBits);
data >>= FreeBits;
@@ -67,8 +67,8 @@ namespace NBitIO {
Active |= bits ? ((data & MaskLowerBits(bits)) << (64ULL - FreeBits)) : 0;
FreeBits -= bits;
- }
-
+ }
+
// Write "bits" lower bits starting from "skipbits" bit.
Y_FORCE_INLINE void Write(ui64 data, ui64 bits, ui64 skipbits) {
Write(data >> skipbits, bits);
@@ -100,7 +100,7 @@ namespace NBitIO {
}
const ui64 padded = FreeBits & 7;
-
+
FreeBits = 64ULL;
Active = 0ULL;