diff options
| author | dvorkanton <[email protected]> | 2022-02-10 16:46:04 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:04 +0300 | 
| commit | ce1ca0f8ad5b8231d32b35629f85bb09beea1bfb (patch) | |
| tree | 19b21fdcf9ef01e0c94a15434fb08a4a555a79e9 /library/cpp/blockcodecs/codecs/fastlz | |
| parent | fc361854fd6ee8d747229b090f0b8018e260d1fb (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/blockcodecs/codecs/fastlz')
| -rw-r--r-- | library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp | 96 | ||||
| -rw-r--r-- | library/cpp/blockcodecs/codecs/fastlz/ya.make | 26 | 
2 files changed, 61 insertions, 61 deletions
| diff --git a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp index da2831fbd24..1fe7bb3a7d5 100644 --- a/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp +++ b/library/cpp/blockcodecs/codecs/fastlz/fastlz.cpp @@ -1,54 +1,54 @@  #include <library/cpp/blockcodecs/core/codecs.h>  #include <library/cpp/blockcodecs/core/common.h>  #include <library/cpp/blockcodecs/core/register.h> - -#include <contrib/libs/fastlz/fastlz.h> - -using namespace NBlockCodecs; - -namespace { -    struct TFastLZCodec: public TAddLengthCodec<TFastLZCodec> { -        inline TFastLZCodec(int level) -            : MyName("fastlz-" + ToString(level)) -            , Level(level) -        { -        } - -        static inline size_t DoMaxCompressedLength(size_t in) noexcept { -            return Max<size_t>(in + in / 20, 128); -        } - -        TStringBuf Name() const noexcept override { -            return MyName; -        } - -        inline size_t DoCompress(const TData& in, void* buf) const { -            if (Level) { -                return fastlz_compress_level(Level, in.data(), in.size(), buf); -            } - -            return fastlz_compress(in.data(), in.size(), buf); -        } - -        inline void DoDecompress(const TData& in, void* out, size_t len) const { -            const int ret = fastlz_decompress(in.data(), in.size(), out, len); - -            if (ret < 0 || (size_t)ret != len) { +  +#include <contrib/libs/fastlz/fastlz.h>  +  +using namespace NBlockCodecs;  +  +namespace {  +    struct TFastLZCodec: public TAddLengthCodec<TFastLZCodec> {  +        inline TFastLZCodec(int level)  +            : MyName("fastlz-" + ToString(level))  +            , Level(level)  +        {  +        }  +  +        static inline size_t DoMaxCompressedLength(size_t in) noexcept {  +            return Max<size_t>(in + in / 20, 128);  +        }  +  +        TStringBuf Name() const noexcept override {  +            return MyName;  +        }  +  +        inline size_t DoCompress(const TData& in, void* buf) const {  +            if (Level) {  +                return fastlz_compress_level(Level, in.data(), in.size(), buf);  +            }  +  +            return fastlz_compress(in.data(), in.size(), buf);  +        }  +  +        inline void DoDecompress(const TData& in, void* out, size_t len) const {  +            const int ret = fastlz_decompress(in.data(), in.size(), out, len);  +  +            if (ret < 0 || (size_t)ret != len) {                   ythrow TDataError() << TStringBuf("can not decompress"); -            } -        } - -        const TString MyName; -        const int Level; -    }; - -    struct TFastLZRegistrar { -        TFastLZRegistrar() { -            for (int i = 0; i < 3; ++i) { +            }  +        }  +  +        const TString MyName;  +        const int Level;  +    };  +  +    struct TFastLZRegistrar {  +        TFastLZRegistrar() {  +            for (int i = 0; i < 3; ++i) {                   RegisterCodec(MakeHolder<TFastLZCodec>(i)); -            } -            RegisterAlias("fastlz", "fastlz-0"); -        } -    }; +            }  +            RegisterAlias("fastlz", "fastlz-0");  +        }  +    };       const TFastLZRegistrar Registrar{}; -} +}  diff --git a/library/cpp/blockcodecs/codecs/fastlz/ya.make b/library/cpp/blockcodecs/codecs/fastlz/ya.make index 59c09b329b3..87bbb298cf4 100644 --- a/library/cpp/blockcodecs/codecs/fastlz/ya.make +++ b/library/cpp/blockcodecs/codecs/fastlz/ya.make @@ -1,14 +1,14 @@ -LIBRARY() - -OWNER(pg) - -PEERDIR( -    contrib/libs/fastlz +LIBRARY()  +  +OWNER(pg)  +  +PEERDIR(  +    contrib/libs/fastlz       library/cpp/blockcodecs/core -) - -SRCS( -    GLOBAL fastlz.cpp -) - -END() +)  +  +SRCS(  +    GLOBAL fastlz.cpp  +)  +  +END()  | 
