diff options
author | Oleg Sidorkin <osidorkin@gmail.com> | 2022-02-10 16:49:36 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:36 +0300 |
commit | f8f6804a3e352897afabc93afcb32081e3fca601 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/on_disk | |
parent | 5ce74d4fee2d42a4b86efc02dfdc704d458760e1 (diff) | |
download | ydb-f8f6804a3e352897afabc93afcb32081e3fca601.tar.gz |
Restoring authorship annotation for Oleg Sidorkin <osidorkin@gmail.com>. Commit 2 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 9003ab74ba..5fa96afdca 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; |