aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/codecs/huffman_codec.cpp
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/codecs/huffman_codec.cpp
parentbee0f5f332db3abff5839ff24ac18000c161a30a (diff)
downloadydb-da648cf6f097dd42d968802dca7734c68ef57d67.tar.gz
Restoring authorship annotation for <solar@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/codecs/huffman_codec.cpp')
-rw-r--r--library/cpp/codecs/huffman_codec.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/codecs/huffman_codec.cpp b/library/cpp/codecs/huffman_codec.cpp
index 650fe7cdfd..a6486af264 100644
--- a/library/cpp/codecs/huffman_codec.cpp
+++ b/library/cpp/codecs/huffman_codec.cpp
@@ -235,20 +235,20 @@ namespace NCodecs {
THuffmanCache(const THuffmanCodec::TImpl& encoder);
void Decode(NBitIO::TBitInput& in, TBuffer& out) const;
- };
-
+ };
+
THolder<THuffmanCache> Cache;
-
+
public:
TImpl()
: SubTablesNum(1)
{
Invalid.CodeLength = 255;
}
-
+
ui8 Encode(TStringBuf in, TBuffer& out) const {
out.Clear();
-
+
if (in.empty()) {
return 0;
}
@@ -302,8 +302,8 @@ namespace NCodecs {
} else {
while (ReadNextChar(bin, out)) {
}
- }
- }
+ }
+ }
}
Y_FORCE_INLINE int ReadNextChar(NBitIO::TBitInput& bin, TBuffer& out) const {
@@ -517,13 +517,13 @@ namespace NCodecs {
DecodeCache.push_back(*it);
}
totalBits += bits;
- }
- }
+ }
+ }
DecodeCache.push_back(0);
CacheEntries.shrink_to_fit();
DecodeCache.shrink_to_fit();
- }
-
+ }
+
void THuffmanCodec::TImpl::THuffmanCache::Decode(NBitIO::TBitInput& bin, TBuffer& out) const {
int bits = 0;
ui64 code = 0;
@@ -541,13 +541,13 @@ namespace NCodecs {
bin.Back(bits);
if (!Original.ReadNextChar(bin, out))
break;
-
+
code = 0;
bits = 0;
}
- }
- }
-
+ }
+ }
+
THuffmanCodec::THuffmanCodec()
: Impl(new TImpl)
{
@@ -588,5 +588,5 @@ namespace NCodecs {
Impl->LearnByFreqs(freqs);
Trained = true;
}
-
+
}