diff options
| author | Oleg Sidorkin <[email protected]> | 2022-02-10 16:49:36 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:36 +0300 | 
| commit | 5ce74d4fee2d42a4b86efc02dfdc704d458760e1 (patch) | |
| tree | f16a3558ca40d453a1c6a2ed764bd75d64cffade /library/cpp/on_disk | |
| parent | cd33f9aa8461f8e2b0b9e68efbb6bc9856197dc9 (diff) | |
Restoring authorship annotation for Oleg Sidorkin <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/on_disk')
| -rw-r--r-- | library/cpp/on_disk/chunks/chunked_helpers.h | 32 | 
1 files changed, 16 insertions, 16 deletions
| diff --git a/library/cpp/on_disk/chunks/chunked_helpers.h b/library/cpp/on_disk/chunks/chunked_helpers.h index 5fa96afdca0..9003ab74bad 100644 --- a/library/cpp/on_disk/chunks/chunked_helpers.h +++ b/library/cpp/on_disk/chunks/chunked_helpers.h @@ -175,12 +175,12 @@ protected:          static TKey GetFirst(const void* self) {              static constexpr size_t offset = offsetof(TThis, Key); -            return ReadUnaligned<TKey>(reinterpret_cast<const char*>(self) + offset); +            return ReadUnaligned<TKey>(reinterpret_cast<const char*>(self) + offset);           }          static TValue GetSecond(const void* self) {              static constexpr size_t offset = offsetof(TThis, Value); -            return ReadUnaligned<TValue>(reinterpret_cast<const char*>(self) + offset); +            return ReadUnaligned<TValue>(reinterpret_cast<const char*>(self) + offset);           }      };  #pragma pack(pop) @@ -205,16 +205,16 @@ protected:              , Length(length)          {          } - -        static inline ui32 GetOffset(const TInterval* self) { -            static constexpr size_t offset = offsetof(TInterval, Offset); -            return ReadUnaligned<ui32>(reinterpret_cast<const char*>(self) + offset); -        } - -        static inline ui32 GetLength(const TInterval* self) { -            static constexpr size_t offset = offsetof(TInterval, Length); -            return ReadUnaligned<ui32>(reinterpret_cast<const char*>(self) + offset); -        } +  +        static inline ui32 GetOffset(const TInterval* self) {  +            static constexpr size_t offset = offsetof(TInterval, Offset);  +            return ReadUnaligned<ui32>(reinterpret_cast<const char*>(self) + offset);  +        }  +  +        static inline ui32 GetLength(const TInterval* self) {  +            static constexpr size_t offset = offsetof(TInterval, Length);  +            return ReadUnaligned<ui32>(reinterpret_cast<const char*>(self) + offset);  +        }       };  #pragma pack(pop)      static_assert(8 == sizeof(TInterval), "expect 8 == sizeof(TInterval)"); @@ -350,10 +350,10 @@ public:      bool Find(typename TTypeTraits<TKey>::TFuncParam key, TValue* res) const {          // Cerr << GetBits() << "\t" << (1 << GetBits()) << "\t" << GetSize() << Endl;          const ui32 hash = KeyHash<TKey>(key, GetBits()); -        const TInterval* intervalPtr = GetIntervals(); -        const TKeyValuePair* pair = GetData() + TInterval::GetOffset(intervalPtr + hash); -        const ui32 length = TInterval::GetLength(intervalPtr + hash); -        for (ui32 i = 0; i < length; ++i, ++pair) { +        const TInterval* intervalPtr = GetIntervals();  +        const TKeyValuePair* pair = GetData() + TInterval::GetOffset(intervalPtr + hash);  +        const ui32 length = TInterval::GetLength(intervalPtr + hash);  +        for (ui32 i = 0; i < length; ++i, ++pair) {               if (TKeyValuePair::GetFirst(pair) == key) {                  *res = TKeyValuePair::GetSecond(pair);                  return true; | 
