aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/zlib.cpp
diff options
context:
space:
mode:
authormyltsev <myltsev@yandex-team.ru>2022-02-10 16:46:03 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:03 +0300
commitfc361854fd6ee8d747229b090f0b8018e260d1fb (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/stream/zlib.cpp
parent9166d66c30c23c9e85a7c88185a068987148d23f (diff)
downloadydb-fc361854fd6ee8d747229b090f0b8018e260d1fb.tar.gz
Restoring authorship annotation for <myltsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream/zlib.cpp')
-rw-r--r--util/stream/zlib.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp
index a9fe352239..60f4e9439f 100644
--- a/util/stream/zlib.cpp
+++ b/util/stream/zlib.cpp
@@ -80,17 +80,17 @@ namespace {
class TZLibDecompress::TImpl: private TZLibCommon, public TChunkedZeroCopyInput {
public:
- inline TImpl(IZeroCopyInput* in, ZLib::StreamType type, TStringBuf dict)
+ inline TImpl(IZeroCopyInput* in, ZLib::StreamType type, TStringBuf dict)
: TChunkedZeroCopyInput(in)
- , Dict(dict)
+ , Dict(dict)
{
if (inflateInit2(Z(), opts[type]) != Z_OK) {
ythrow TZLibDecompressorError() << "can not init inflate engine";
}
-
- if (dict.size() && type == ZLib::Raw) {
- SetDict();
- }
+
+ if (dict.size() && type == ZLib::Raw) {
+ SetDict();
+ }
}
virtual ~TImpl() {
@@ -113,11 +113,11 @@ public:
}
switch (inflate(Z(), Z_SYNC_FLUSH)) {
- case Z_NEED_DICT: {
- SetDict();
- continue;
- }
-
+ case Z_NEED_DICT: {
+ SetDict();
+ continue;
+ }
+
case Z_STREAM_END: {
if (AllowMultipleStreams_) {
if (inflateReset(Z()) != Z_OK) {
@@ -151,21 +151,21 @@ private:
return Next(&Z()->next_in, &Z()->avail_in);
}
- void SetDict() {
- if (inflateSetDictionary(Z(), (const Bytef*)Dict.data(), Dict.size()) != Z_OK) {
- ythrow TZLibCompressorError() << "can not set inflate dictionary";
- }
- }
-
+ void SetDict() {
+ if (inflateSetDictionary(Z(), (const Bytef*)Dict.data(), Dict.size()) != Z_OK) {
+ ythrow TZLibCompressorError() << "can not set inflate dictionary";
+ }
+ }
+
bool AllowMultipleStreams_ = true;
- TStringBuf Dict;
+ TStringBuf Dict;
};
namespace {
class TDecompressStream: public IZeroCopyInput, public TZLibDecompress::TImpl, public TAdditionalStorage<TDecompressStream> {
public:
- inline TDecompressStream(IInputStream* input, ZLib::StreamType type, TStringBuf dict)
- : TZLibDecompress::TImpl(this, type, dict)
+ inline TDecompressStream(IInputStream* input, ZLib::StreamType type, TStringBuf dict)
+ : TZLibDecompress::TImpl(this, type, dict)
, Stream_(input)
{
}
@@ -318,13 +318,13 @@ private:
THolder<gz_header> GZHeader_;
};
-TZLibDecompress::TZLibDecompress(IZeroCopyInput* input, ZLib::StreamType type, TStringBuf dict)
- : Impl_(new TZeroCopyDecompress(input, type, dict))
+TZLibDecompress::TZLibDecompress(IZeroCopyInput* input, ZLib::StreamType type, TStringBuf dict)
+ : Impl_(new TZeroCopyDecompress(input, type, dict))
{
}
-TZLibDecompress::TZLibDecompress(IInputStream* input, ZLib::StreamType type, size_t buflen, TStringBuf dict)
- : Impl_(new (buflen) TDecompressStream(input, type, dict))
+TZLibDecompress::TZLibDecompress(IInputStream* input, ZLib::StreamType type, size_t buflen, TStringBuf dict)
+ : Impl_(new (buflen) TDecompressStream(input, type, dict))
{
}