diff options
author | pritula <pritula@yandex-team.ru> | 2022-02-10 16:50:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:53 +0300 |
commit | 67060456f1386d2ddd6313929f48dc92356a0ff6 (patch) | |
tree | 3c7fa49a87ce72d7d5c6a3d282d9f99c476a79d9 /library/cpp/archive | |
parent | 9905811fdc643c722d6464b8cf6661f931510f2f (diff) | |
download | ydb-67060456f1386d2ddd6313929f48dc92356a0ff6.tar.gz |
Restoring authorship annotation for <pritula@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/archive')
-rw-r--r-- | library/cpp/archive/yarchive.cpp | 34 | ||||
-rw-r--r-- | library/cpp/archive/yarchive.h | 2 |
2 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/archive/yarchive.cpp b/library/cpp/archive/yarchive.cpp index 1becc3e5da..b014d3e93b 100644 --- a/library/cpp/archive/yarchive.cpp +++ b/library/cpp/archive/yarchive.cpp @@ -172,16 +172,16 @@ public: Off_ += out.Counter(); } - inline void AddSynonym(const TString& existingKey, const TString& newKey) { + inline void AddSynonym(const TString& existingKey, const TString& newKey) { Y_ENSURE(Dict_.contains(existingKey), "key " << existingKey.data() << " not stored yet"); Y_ENSURE(!Dict_.contains(newKey), "key " << newKey.data() << " already stored"); - - TArchiveRecordDescriptorRef existingDescr = Dict_[existingKey]; - TArchiveRecordDescriptorRef descr(new TArchiveRecordDescriptor(existingDescr->Offset(), existingDescr->Length(), newKey)); - - Dict_[newKey] = descr; - } - + + TArchiveRecordDescriptorRef existingDescr = Dict_[existingKey]; + TArchiveRecordDescriptorRef descr(new TArchiveRecordDescriptor(existingDescr->Offset(), existingDescr->Length(), newKey)); + + Dict_[newKey] = descr; + } + private: ui64 Off_; IOutputStream* Out_; @@ -215,17 +215,17 @@ void TArchiveWriter::Finish() { } void TArchiveWriter::Add(const TString& key, IInputStream* src) { - Y_ENSURE(Impl_.Get(), "archive already closed"); + Y_ENSURE(Impl_.Get(), "archive already closed"); Impl_->Add(key, src); } -void TArchiveWriter::AddSynonym(const TString& existingKey, const TString& newKey) { - Y_ENSURE(Impl_.Get(), "archive already closed"); - - Impl_->AddSynonym(existingKey, newKey); -} - +void TArchiveWriter::AddSynonym(const TString& existingKey, const TString& newKey) { + Y_ENSURE(Impl_.Get(), "archive already closed"); + + Impl_->AddSynonym(existingKey, newKey); +} + namespace { class TArchiveInputStreamBase { public: @@ -266,7 +266,7 @@ public: inline ~TImpl() = default; inline void ReadDict() { - Y_ENSURE(Blob_.Size() >= sizeof(ui64), "too small blob"); + Y_ENSURE(Blob_.Size() >= sizeof(ui64), "too small blob"); const char* end = (const char*)Blob_.End(); const char* ptr = end - sizeof(ui64); @@ -274,7 +274,7 @@ public: memcpy(&dictlen, ptr, sizeof(ui64)); dictlen = LittleToHost(dictlen); - Y_ENSURE(dictlen <= Blob_.Size() - sizeof(ui64), "bad blob"); + Y_ENSURE(dictlen <= Blob_.Size() - sizeof(ui64), "bad blob"); const char* beg = ptr - dictlen; TMemoryInput mi(beg, dictlen); diff --git a/library/cpp/archive/yarchive.h b/library/cpp/archive/yarchive.h index 8120bcb940..b871362c14 100644 --- a/library/cpp/archive/yarchive.h +++ b/library/cpp/archive/yarchive.h @@ -22,7 +22,7 @@ public: void Flush(); void Finish(); void Add(const TString& key, IInputStream* src); - void AddSynonym(const TString& existingKey, const TString& newKey); + void AddSynonym(const TString& existingKey, const TString& newKey); private: class TImpl; |