aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/binsaver/bin_saver.cpp
diff options
context:
space:
mode:
authorfoton <foton@yandex-team.ru>2022-02-10 16:49:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:25 +0300
commit1e0b5488cdce503f4d970e8163823bba9126aedc (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/binsaver/bin_saver.cpp
parent80199ea5aaaa9a0af0c3845eec4a4162edc74105 (diff)
downloadydb-1e0b5488cdce503f4d970e8163823bba9126aedc.tar.gz
Restoring authorship annotation for <foton@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/binsaver/bin_saver.cpp')
-rw-r--r--library/cpp/binsaver/bin_saver.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/binsaver/bin_saver.cpp b/library/cpp/binsaver/bin_saver.cpp
index 8ccc395b0d8..fe0775af9f2 100644
--- a/library/cpp/binsaver/bin_saver.cpp
+++ b/library/cpp/binsaver/bin_saver.cpp
@@ -17,30 +17,30 @@ void IBinSaver::StoreObject(IObjectBase* pObject) {
if (pObject) {
Y_ASSERT(pSaverClasses->GetObjectTypeID(pObject) != -1 && "trying to save unregistered object");
}
-
+
ui64 ptrId = ((char*)pObject) - ((char*)nullptr);
- if (StableOutput) {
- ui32 id = 0;
- if (pObject) {
- if (!PtrIds.Get())
- PtrIds.Reset(new PtrIdHash);
- PtrIdHash::iterator pFound = PtrIds->find(pObject);
- if (pFound != PtrIds->end())
- id = pFound->second;
- else {
+ if (StableOutput) {
+ ui32 id = 0;
+ if (pObject) {
+ if (!PtrIds.Get())
+ PtrIds.Reset(new PtrIdHash);
+ PtrIdHash::iterator pFound = PtrIds->find(pObject);
+ if (pFound != PtrIds->end())
+ id = pFound->second;
+ else {
id = PtrIds->ysize() + 1;
PtrIds->insert(std::make_pair(pObject, id));
- }
- }
+ }
+ }
ptrId = id;
- }
-
- DataChunk(&ptrId, sizeof(ptrId));
+ }
+
+ DataChunk(&ptrId, sizeof(ptrId));
if (!Objects.Get())
Objects.Reset(new CObjectsHash);
- if (ptrId != 0 && Objects->find(ptrId) == Objects->end()) {
+ if (ptrId != 0 && Objects->find(ptrId) == Objects->end()) {
ObjectQueue.push_back(pObject);
- (*Objects)[ptrId];
+ (*Objects)[ptrId];
int typeId = pSaverClasses->GetObjectTypeID(pObject);
if (typeId == -1) {
fprintf(stderr, "IBinSaver: trying to save unregistered object\n");