diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/stream/zlib.cpp | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/stream/zlib.cpp')
-rw-r--r-- | util/stream/zlib.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 7e065aab61..60f4e9439f 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -22,17 +22,17 @@ namespace { class TZLibCommon { public: - inline TZLibCommon() noexcept { + inline TZLibCommon() noexcept { memset(Z(), 0, sizeof(*Z())); } inline ~TZLibCommon() = default; - inline const char* GetErrMsg() const noexcept { + inline const char* GetErrMsg() const noexcept { return Z()->msg != nullptr ? Z()->msg : "unknown error"; } - inline z_stream* Z() const noexcept { + inline z_stream* Z() const noexcept { return (z_stream*)(&Z_); } @@ -40,7 +40,7 @@ namespace { z_stream Z_; }; - static inline ui32 MaxPortion(size_t s) noexcept { + static inline ui32 MaxPortion(size_t s) noexcept { return (ui32)Min<size_t>(Max<ui32>(), s); } @@ -225,7 +225,7 @@ public: Z()->avail_out = TmpBufLen(); } - inline ~TImpl() { + inline ~TImpl() { deflateEnd(Z()); } @@ -305,11 +305,11 @@ public: } private: - inline unsigned char* TmpBuf() noexcept { + inline unsigned char* TmpBuf() noexcept { return (unsigned char*)AdditionalData(); } - inline size_t TmpBufLen() const noexcept { + inline size_t TmpBufLen() const noexcept { return AdditionalDataLength(); } @@ -347,7 +347,7 @@ void TZLibCompress::TDestruct::Destroy(TImpl* impl) { delete impl; } -TZLibCompress::~TZLibCompress() { +TZLibCompress::~TZLibCompress() { try { Finish(); } catch (...) { |