diff options
author | Arseny Smalyuk <smalukav@gmail.com> | 2022-02-10 16:48:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:05 +0300 |
commit | 5f8a2ce7b1dc3b3e1fae197610f189e7ed1d5723 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/stream/zlib.cpp | |
parent | 12559cd7f2fa0cf54ffb0d961949fea58c0e18cb (diff) | |
download | ydb-5f8a2ce7b1dc3b3e1fae197610f189e7ed1d5723.tar.gz |
Restoring authorship annotation for Arseny Smalyuk <smalukav@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/stream/zlib.cpp')
-rw-r--r-- | util/stream/zlib.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 983b753dc2..60f4e9439f 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -267,20 +267,20 @@ public: } inline void Flush() { - int ret = deflate(Z(), Z_SYNC_FLUSH); - - while ((ret == Z_OK || ret == Z_BUF_ERROR) && !Z()->avail_out) { - FlushBuffer(); - ret = deflate(Z(), Z_SYNC_FLUSH); - } - - if (ret != Z_OK && ret != Z_BUF_ERROR) { - ythrow TZLibCompressorError() << "deflate flush error(" << GetErrMsg() << ")"; - } - - if (Z()->avail_out < TmpBufLen()) { - FlushBuffer(); - } + int ret = deflate(Z(), Z_SYNC_FLUSH); + + while ((ret == Z_OK || ret == Z_BUF_ERROR) && !Z()->avail_out) { + FlushBuffer(); + ret = deflate(Z(), Z_SYNC_FLUSH); + } + + if (ret != Z_OK && ret != Z_BUF_ERROR) { + ythrow TZLibCompressorError() << "deflate flush error(" << GetErrMsg() << ")"; + } + + if (Z()->avail_out < TmpBufLen()) { + FlushBuffer(); + } } inline void FlushBuffer() { @@ -300,7 +300,7 @@ public: if (ret == Z_STREAM_END) { Stream_->Write(TmpBuf(), TmpBufLen() - Z()->avail_out); } else { - ythrow TZLibCompressorError() << "deflate finish error(" << GetErrMsg() << ")"; + ythrow TZLibCompressorError() << "deflate finish error(" << GetErrMsg() << ")"; } } @@ -339,7 +339,7 @@ size_t TZLibDecompress::DoRead(void* buf, size_t size) { } void TZLibCompress::Init(const TParams& params) { - Y_ENSURE(params.BufLen >= 16, "ZLib buffer too small"); + Y_ENSURE(params.BufLen >= 16, "ZLib buffer too small"); Impl_.Reset(new (params.BufLen) TImpl(params)); } |