diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/blockcodecs | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/blockcodecs')
-rw-r--r-- | library/cpp/blockcodecs/codecs/brotli/brotli.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/bzip/bzip.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp | 8 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/lz4/lz4.cpp | 8 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/lzma/lzma.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/snappy/snappy.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/zlib/zlib.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs/zstd/zstd.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs_ut.cpp | 12 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/codecs.cpp | 10 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/codecs.h | 20 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/common.h | 4 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/stream.cpp | 4 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/stream.h | 4 |
15 files changed, 42 insertions, 42 deletions
diff --git a/library/cpp/blockcodecs/codecs/brotli/brotli.cpp b/library/cpp/blockcodecs/codecs/brotli/brotli.cpp index 6e3cd971bd..a23765b0d4 100644 --- a/library/cpp/blockcodecs/codecs/brotli/brotli.cpp +++ b/library/cpp/blockcodecs/codecs/brotli/brotli.cpp @@ -59,7 +59,7 @@ namespace { struct TBrotliRegistrar { TBrotliRegistrar() { for (int i = 1; i <= TBrotliCodec::BEST_QUALITY; ++i) { - RegisterCodec(MakeHolder<TBrotliCodec>(i)); + RegisterCodec(MakeHolder<TBrotliCodec>(i)); } } }; diff --git a/library/cpp/blockcodecs/codecs/bzip/bzip.cpp b/library/cpp/blockcodecs/codecs/bzip/bzip.cpp index 3a5cfdd0e9..230165e817 100644 --- a/library/cpp/blockcodecs/codecs/bzip/bzip.cpp +++ b/library/cpp/blockcodecs/codecs/bzip/bzip.cpp @@ -53,7 +53,7 @@ namespace { struct TBZipRegistrar { TBZipRegistrar() { for (int i = 1; i < 10; ++i) { - RegisterCodec(MakeHolder<TBZipCodec>(i)); + RegisterCodec(MakeHolder<TBZipCodec>(i)); } RegisterAlias("bzip2", "bzip2-6"); } diff --git a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp index da2831fbd2..49c8bb5902 100644 --- a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp +++ b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp @@ -45,7 +45,7 @@ namespace { struct TFastLZRegistrar { TFastLZRegistrar() { for (int i = 0; i < 3; ++i) { - RegisterCodec(MakeHolder<TFastLZCodec>(i)); + RegisterCodec(MakeHolder<TFastLZCodec>(i)); } RegisterAlias("fastlz", "fastlz-0"); } diff --git a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp index 042f031679..0416ff964f 100644 --- a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp +++ b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp @@ -23,7 +23,7 @@ namespace { return ret; } - static inline size_t DoMaxCompressedLength(size_t l) noexcept { + static inline size_t DoMaxCompressedLength(size_t l) noexcept { return ZSTD_compressBound(l); } @@ -39,18 +39,18 @@ namespace { } } - TStringBuf Name() const noexcept override { + TStringBuf Name() const noexcept override { return MyName; } const unsigned Level; - const TString MyName; + const TString MyName; }; struct TZStd06Registrar { TZStd06Registrar() { for (unsigned i = 1; i <= ZSTD_maxCLevel(); ++i) { - RegisterCodec(MakeHolder<TZStd06Codec>(i)); + RegisterCodec(MakeHolder<TZStd06Codec>(i)); } } }; diff --git a/library/cpp/blockcodecs/codecs/lz4/lz4.cpp b/library/cpp/blockcodecs/codecs/lz4/lz4.cpp index fbf0fe110f..f800b50316 100644 --- a/library/cpp/blockcodecs/codecs/lz4/lz4.cpp +++ b/library/cpp/blockcodecs/codecs/lz4/lz4.cpp @@ -101,16 +101,16 @@ namespace { THolder<T2> t2(new T2(i)); if (t1->Methods) { - RegisterCodec(std::move(t1)); + RegisterCodec(std::move(t1)); } if (t2->Methods) { - RegisterCodec(std::move(t2)); + RegisterCodec(std::move(t2)); } } - RegisterCodec(MakeHolder<TLz4Codec<TLz4BestCompress, TLz4FastDecompress>>()); - RegisterCodec(MakeHolder<TLz4Codec<TLz4BestCompress, TLz4SafeDecompress>>()); + RegisterCodec(MakeHolder<TLz4Codec<TLz4BestCompress, TLz4FastDecompress>>()); + RegisterCodec(MakeHolder<TLz4Codec<TLz4BestCompress, TLz4SafeDecompress>>()); RegisterAlias("lz4-fast-safe", "lz4-fast14-safe"); RegisterAlias("lz4-fast-fast", "lz4-fast14-fast"); diff --git a/library/cpp/blockcodecs/codecs/lzma/lzma.cpp b/library/cpp/blockcodecs/codecs/lzma/lzma.cpp index 6c8d5fded4..ab3a2466f5 100644 --- a/library/cpp/blockcodecs/codecs/lzma/lzma.cpp +++ b/library/cpp/blockcodecs/codecs/lzma/lzma.cpp @@ -65,7 +65,7 @@ namespace { struct TLzmaRegistrar { TLzmaRegistrar() { for (int i = 0; i < 10; ++i) { - RegisterCodec(MakeHolder<TLzmaCodec>(i)); + RegisterCodec(MakeHolder<TLzmaCodec>(i)); } RegisterAlias("lzma", "lzma-5"); } diff --git a/library/cpp/blockcodecs/codecs/snappy/snappy.cpp b/library/cpp/blockcodecs/codecs/snappy/snappy.cpp index f6be05a05f..44d8c140a4 100644 --- a/library/cpp/blockcodecs/codecs/snappy/snappy.cpp +++ b/library/cpp/blockcodecs/codecs/snappy/snappy.cpp @@ -45,7 +45,7 @@ namespace { struct TSnappyRegistrar { TSnappyRegistrar() { - RegisterCodec(MakeHolder<TSnappyCodec>()); + RegisterCodec(MakeHolder<TSnappyCodec>()); } }; const TSnappyRegistrar Registrar{}; diff --git a/library/cpp/blockcodecs/codecs/zlib/zlib.cpp b/library/cpp/blockcodecs/codecs/zlib/zlib.cpp index cdb556c36d..fc1f602d9f 100644 --- a/library/cpp/blockcodecs/codecs/zlib/zlib.cpp +++ b/library/cpp/blockcodecs/codecs/zlib/zlib.cpp @@ -55,7 +55,7 @@ namespace { struct TZLibRegistrar { TZLibRegistrar() { for (int i = 0; i < 10; ++i) { - RegisterCodec(MakeHolder<TZLibCodec>(i)); + RegisterCodec(MakeHolder<TZLibCodec>(i)); } RegisterAlias("zlib", "zlib-6"); } diff --git a/library/cpp/blockcodecs/codecs/zstd/zstd.cpp b/library/cpp/blockcodecs/codecs/zstd/zstd.cpp index 95299b3f6d..3f905c8687 100644 --- a/library/cpp/blockcodecs/codecs/zstd/zstd.cpp +++ b/library/cpp/blockcodecs/codecs/zstd/zstd.cpp @@ -50,7 +50,7 @@ namespace { struct TZStd08Registrar { TZStd08Registrar() { for (int i = 1; i <= ZSTD_maxCLevel(); ++i) { - RegisterCodec(MakeHolder<TZStd08Codec>(i)); + RegisterCodec(MakeHolder<TZStd08Codec>(i)); RegisterAlias("zstd_" + ToString(i), "zstd08_" + ToString(i)); } } diff --git a/library/cpp/blockcodecs/codecs_ut.cpp b/library/cpp/blockcodecs/codecs_ut.cpp index bfe5a23690..d5e167b85e 100644 --- a/library/cpp/blockcodecs/codecs_ut.cpp +++ b/library/cpp/blockcodecs/codecs_ut.cpp @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { } void TestAllAtOnce(size_t n, size_t m) { - TVector<TBuffer> datas; + TVector<TBuffer> datas; datas.emplace_back(); datas.push_back(Buffer("na gorshke sidel korol")); @@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { for (size_t j = 0; j < datas.size(); ++j) { const TBuffer& data = datas[j]; - TString res; + TString res; try { TBuffer e, d; @@ -144,11 +144,11 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { } void TestStreams(size_t n, size_t m) { - TVector<TString> datas; - TString res; + TVector<TString> datas; + TString res; for (size_t i = 0; i < 256; ++i) { - datas.push_back(TString(i, (char)(i % 128))); + datas.push_back(TString(i, (char)(i % 128))); } for (size_t i = 0; i < datas.size(); ++i) { @@ -178,7 +178,7 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { out.Finish(); } - const TString resNew = TDecodedInput(&ss).ReadAll(); + const TString resNew = TDecodedInput(&ss).ReadAll(); try { UNIT_ASSERT_EQUAL(resNew, res); diff --git a/library/cpp/blockcodecs/core/codecs.cpp b/library/cpp/blockcodecs/core/codecs.cpp index 21506e812b..072da37087 100644 --- a/library/cpp/blockcodecs/core/codecs.cpp +++ b/library/cpp/blockcodecs/core/codecs.cpp @@ -61,8 +61,8 @@ namespace { TDeque<TString> Tmp; TNullCodec Null; - TVector<TCodecPtr> Codecs; - typedef THashMap<TStringBuf, ICodec*> TRegistry; + TVector<TCodecPtr> Codecs; + typedef THashMap<TStringBuf, ICodec*> TRegistry; TRegistry Registry; // SEARCH-8344: Global decompressed size limiter (to prevent remote DoS) @@ -82,7 +82,7 @@ TCodecList NBlockCodecs::ListAllCodecs() { return ret; } -TString NBlockCodecs::ListAllCodecsAsString() { +TString NBlockCodecs::ListAllCodecsAsString() { return JoinSeq(TStringBuf(","), ListAllCodecs()); } @@ -127,7 +127,7 @@ void ICodec::Decode(const TData& in, TBuffer& out) const { out.Resize(Decompress(in, out.Data())); } -void ICodec::Encode(const TData& in, TString& out) const { +void ICodec::Encode(const TData& in, TString& out) const { const size_t maxLen = MaxCompressedLength(in); out.ReserveAndResize(maxLen); @@ -136,7 +136,7 @@ void ICodec::Encode(const TData& in, TString& out) const { out.resize(actualLen); } -void ICodec::Decode(const TData& in, TString& out) const { +void ICodec::Decode(const TData& in, TString& out) const { const size_t maxLen = GetDecompressedLength(in); out.ReserveAndResize(maxLen); diff --git a/library/cpp/blockcodecs/core/codecs.h b/library/cpp/blockcodecs/core/codecs.h index 9c93c00274..878678d5c7 100644 --- a/library/cpp/blockcodecs/core/codecs.h +++ b/library/cpp/blockcodecs/core/codecs.h @@ -2,7 +2,7 @@ #include <util/generic/buffer.h> #include <util/generic/strbuf.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/typetraits.h> #include <util/generic/vector.h> #include <util/generic/yexception.h> @@ -45,25 +45,25 @@ namespace NBlockCodecs { virtual size_t Compress(const TData& in, void* out) const = 0; virtual size_t Decompress(const TData& in, void* out) const = 0; - virtual TStringBuf Name() const noexcept = 0; + virtual TStringBuf Name() const noexcept = 0; // some useful helpers void Encode(const TData& in, TBuffer& out) const; void Decode(const TData& in, TBuffer& out) const; - void Encode(const TData& in, TString& out) const; - void Decode(const TData& in, TString& out) const; + void Encode(const TData& in, TString& out) const; + void Decode(const TData& in, TString& out) const; - inline TString Encode(const TData& in) const { - TString out; + inline TString Encode(const TData& in) const { + TString out; Encode(in, out); return out; } - inline TString Decode(const TData& in) const { - TString out; + inline TString Decode(const TData& in) const { + TString out; Decode(in, out); @@ -78,9 +78,9 @@ namespace NBlockCodecs { const ICodec* Codec(const TStringBuf& name); // some aux methods - typedef TVector<TStringBuf> TCodecList; + typedef TVector<TStringBuf> TCodecList; TCodecList ListAllCodecs(); - TString ListAllCodecsAsString(); + TString ListAllCodecsAsString(); // SEARCH-8344: Get the size of max possible decompressed block size_t GetMaxPossibleDecompressedLength(); diff --git a/library/cpp/blockcodecs/core/common.h b/library/cpp/blockcodecs/core/common.h index f05df4d334..8e1dabb593 100644 --- a/library/cpp/blockcodecs/core/common.h +++ b/library/cpp/blockcodecs/core/common.h @@ -55,7 +55,7 @@ namespace NBlockCodecs { return in.size(); } - TStringBuf Name() const noexcept override { + TStringBuf Name() const noexcept override { return TStringBuf("null"); } }; @@ -98,7 +98,7 @@ namespace NBlockCodecs { return len; } - inline const T* Base() const noexcept { + inline const T* Base() const noexcept { return static_cast<const T*>(this); } }; diff --git a/library/cpp/blockcodecs/core/stream.cpp b/library/cpp/blockcodecs/core/stream.cpp index 4f7db3c32b..856400b5a1 100644 --- a/library/cpp/blockcodecs/core/stream.cpp +++ b/library/cpp/blockcodecs/core/stream.cpp @@ -51,7 +51,7 @@ namespace { ythrow yexception() << "can not find codec by id " << id; } - typedef THashMap<TCodecID, const ICodec*> TByID; + typedef THashMap<TCodecID, const ICodec*> TByID; TByID ByID; }; @@ -74,7 +74,7 @@ TCodedOutput::TCodedOutput(IOutputStream* out, const ICodec* c, size_t bufLen) } } -TCodedOutput::~TCodedOutput() { +TCodedOutput::~TCodedOutput() { try { Finish(); } catch (...) { diff --git a/library/cpp/blockcodecs/core/stream.h b/library/cpp/blockcodecs/core/stream.h index fd44ef88f2..92ccd10333 100644 --- a/library/cpp/blockcodecs/core/stream.h +++ b/library/cpp/blockcodecs/core/stream.h @@ -12,7 +12,7 @@ namespace NBlockCodecs { class TCodedOutput: public IOutputStream { public: TCodedOutput(IOutputStream* out, const ICodec* c, size_t bufLen); - ~TCodedOutput() override; + ~TCodedOutput() override; private: void DoWrite(const void* buf, size_t len) override; @@ -33,7 +33,7 @@ namespace NBlockCodecs { TDecodedInput(IInputStream* in); TDecodedInput(IInputStream* in, const ICodec* codec); - ~TDecodedInput() override; + ~TDecodedInput() override; private: size_t DoUnboundedNext(const void** ptr) override; |