diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | bd30392c4cc92487950adc375c07adf52da1d592 (patch) | |
tree | e8d1a3f19b7fc890bcef6e4cc5de41f1d88c9ac3 /library/cpp/on_disk | |
parent | 5d50718e66d9c037dc587a0211110b7d25a66185 (diff) | |
download | ydb-bd30392c4cc92487950adc375c07adf52da1d592.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/on_disk')
-rw-r--r-- | library/cpp/on_disk/chunks/reader.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/library/cpp/on_disk/chunks/reader.cpp b/library/cpp/on_disk/chunks/reader.cpp index 6e28cbf367..ae54e844a9 100644 --- a/library/cpp/on_disk/chunks/reader.cpp +++ b/library/cpp/on_disk/chunks/reader.cpp @@ -12,11 +12,11 @@ static inline void ReadAux(const char* data, T* aux, T count, TVector<const char } } -TChunkedDataReader::TChunkedDataReader(const TBlob& blob) { +TChunkedDataReader::TChunkedDataReader(const TBlob& blob) { const char* cdata = blob.AsCharPtr(); const size_t size = blob.Size(); - Y_ENSURE(size >= sizeof(ui32), "Empty file with chunks. "); - + Y_ENSURE(size >= sizeof(ui32), "Empty file with chunks. "); + ui32 last = ReadUnaligned<ui32>((ui32*)(cdata + size) - 1); if (last != 0) { // old version file @@ -29,11 +29,11 @@ TChunkedDataReader::TChunkedDataReader(const TBlob& blob) { return; } - Y_ENSURE(size >= 3 * sizeof(ui64), "Blob size must be >= 3 * sizeof(ui64). "); - + Y_ENSURE(size >= 3 * sizeof(ui64), "Blob size must be >= 3 * sizeof(ui64). "); + ui64* aux = (ui64*)(cdata + size); Version = ReadUnaligned<ui64>(aux - 2); - Y_ENSURE(Version > 0, "Invalid chunked array version. "); + Y_ENSURE(Version > 0, "Invalid chunked array version. "); ui64 count = ReadUnaligned<ui64>(aux - 3); |