diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/archive | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/archive')
-rw-r--r-- | library/cpp/archive/directory_models_archive_reader.cpp | 28 | ||||
-rw-r--r-- | library/cpp/archive/yarchive.cpp | 6 |
2 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/archive/directory_models_archive_reader.cpp b/library/cpp/archive/directory_models_archive_reader.cpp index f37fbdc613..6de9424c7c 100644 --- a/library/cpp/archive/directory_models_archive_reader.cpp +++ b/library/cpp/archive/directory_models_archive_reader.cpp @@ -1,5 +1,5 @@ #include "directory_models_archive_reader.h" -#include "yarchive.h" +#include "yarchive.h" #include <util/folder/dirut.h> #include <util/folder/filelist.h> @@ -81,29 +81,29 @@ void TDirectoryModelsArchiveReader::LoadFilesAndSubdirs(const TString& subPath, while ((file = fileList.Next()) != nullptr) { TString key = JoinFsPaths(subPath, TString(file)); TString fullPath = JoinFsPaths(Path_, key); - TBlob fileBlob; + TBlob fileBlob; if (lockMemory) { fileBlob = TBlob::LockedFromFile(fullPath); } else { fileBlob = TBlob::FromFile(fullPath); } - if (key.EndsWith(".archive")) { - TArchiveReader reader(fileBlob); - for (size_t i = 0, iEnd = reader.Count(); i < iEnd; ++i) { - const TString archiveKey = reader.KeyByIndex(i); - const TString normalizedPath = NormalizePath(JoinFsPaths(subPath, archiveKey.substr(1))); - BlobByKey_.emplace(normalizedPath, reader.ObjectBlobByKey(archiveKey)); - Recs_.push_back(normalizedPath); - } - } else { - const TString normalizedPath = NormalizePath(key); + if (key.EndsWith(".archive")) { + TArchiveReader reader(fileBlob); + for (size_t i = 0, iEnd = reader.Count(); i < iEnd; ++i) { + const TString archiveKey = reader.KeyByIndex(i); + const TString normalizedPath = NormalizePath(JoinFsPaths(subPath, archiveKey.substr(1))); + BlobByKey_.emplace(normalizedPath, reader.ObjectBlobByKey(archiveKey)); + Recs_.push_back(normalizedPath); + } + } else { + const TString normalizedPath = NormalizePath(key); if (lockMemory || ownBlobs) { BlobByKey_.emplace(normalizedPath, fileBlob); } else { PathByKey_.emplace(normalizedPath, RealPath(fullPath)); } - Recs_.push_back(normalizedPath); - } + Recs_.push_back(normalizedPath); + } } TDirsList dirsList; diff --git a/library/cpp/archive/yarchive.cpp b/library/cpp/archive/yarchive.cpp index 1a885c1408..1becc3e5da 100644 --- a/library/cpp/archive/yarchive.cpp +++ b/library/cpp/archive/yarchive.cpp @@ -23,8 +23,8 @@ static inline void ESSave(IOutputStream* out, const T& t_in) { } static inline void ESSave(IOutputStream* out, const TString& s) { - ESSave(out, (ui32) s.size()); - out->Write(s.data(), s.size()); + ESSave(out, (ui32) s.size()); + out->Write(s.data(), s.size()); } template <class T> @@ -339,7 +339,7 @@ public: inline TBlob BlobByKey(const TStringBuf key) const { const auto it = Dict_.find(key); - Y_ENSURE(it != Dict_.end(), "key " << key.data() << " not found"); + Y_ENSURE(it != Dict_.end(), "key " << key.data() << " not found"); const size_t off = it->second->Offset(); const size_t len = it->second->Length(); |