diff options
author | ironpeter <ironpeter@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:52 +0300 |
commit | edee5b99e1eec042f46725b89dcd81ea7e41d663 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/compproto/compressor.h | |
parent | ff97837ecc5972a00cb395483d8856566738375c (diff) | |
download | ydb-edee5b99e1eec042f46725b89dcd81ea7e41d663.tar.gz |
Restoring authorship annotation for <ironpeter@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/compproto/compressor.h')
-rw-r--r-- | library/cpp/compproto/compressor.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/compproto/compressor.h b/library/cpp/compproto/compressor.h index 1fb678e04e..14b335e13c 100644 --- a/library/cpp/compproto/compressor.h +++ b/library/cpp/compproto/compressor.h @@ -1,5 +1,5 @@ -#pragma once - +#pragma once + #include <util/system/defaults.h> namespace NCompProto { @@ -15,7 +15,7 @@ namespace NCompProto { PrefLength[i] = 0; Id[i] = 0; } - } + } ui32 CodeBase[64]; ui32 CodeMask[64]; ui8 Length[64]; @@ -23,15 +23,15 @@ namespace NCompProto { ui8 Id[64]; enum { PAGE_BOUND = 4096, -#ifdef WITH_VALGRIND +#ifdef WITH_VALGRIND SAFE_MODE = 1, -#else +#else #if defined(__has_feature) #if __has_feature(address_sanitizer) SAFE_MODE = 1, #else SAFE_MODE = 0, -#endif +#endif #else SAFE_MODE = 0, #endif @@ -44,7 +44,7 @@ namespace NCompProto { if (pageOff > PAGE_BOUND - 8 || SAFE_MODE) { size_t off = 8; ui64 res = codes[0]; - ++codes; + ++codes; ui64 indexCur = ((res + 0x0000) >> readOff) & 63; ui64 indexAlt = ((res + 0xff00) >> readOff) & 63; if (Id[indexCur] != Id[indexAlt]) { @@ -63,12 +63,12 @@ namespace NCompProto { offset += length; ui64 code = res >> readOff; return (((ui32)(code >> PrefLength[index])) & CodeMask[index]) + CodeBase[index]; - } + } ui64 code = ((const ui64*)(codes))[0] >> readOff; ui64 index = code & 63; offset += Length[index]; - return (((ui32)(code >> PrefLength[index])) & CodeMask[index]) + CodeBase[index]; - } + return (((ui32)(code >> PrefLength[index])) & CodeMask[index]) + CodeBase[index]; + } }; } |