Skip to content

Commit 273466e

Browse files
Constant scalars: Don't flush double (#1315)
Paths were created in duplicate
1 parent 5edf3ef commit 273466e

2 files changed

Lines changed: 33 additions & 23 deletions

File tree

src/Mesh.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,25 +243,29 @@ void Mesh::flush_impl(
243243
pCreate.path = name;
244244
IOHandler()->enqueue(IOTask(this, pCreate));
245245
for (auto &comp : *this)
246+
{
246247
comp.second.parent() = &this->writable();
248+
comp.second.flush(comp.first, flushParams);
249+
}
247250
}
248251
}
249-
250-
if (scalar())
252+
else
251253
{
252-
for (auto &comp : *this)
254+
if (scalar())
253255
{
254-
comp.second.flush(name, flushParams);
255-
writable().abstractFilePosition =
256-
comp.second.writable().abstractFilePosition;
256+
for (auto &comp : *this)
257+
{
258+
comp.second.flush(name, flushParams);
259+
writable().abstractFilePosition =
260+
comp.second.writable().abstractFilePosition;
261+
}
262+
}
263+
else
264+
{
265+
for (auto &comp : *this)
266+
comp.second.flush(comp.first, flushParams);
257267
}
258268
}
259-
else
260-
{
261-
for (auto &comp : *this)
262-
comp.second.flush(comp.first, flushParams);
263-
}
264-
265269
flushAttributes(flushParams);
266270
break;
267271
}

src/Record.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,29 @@ void Record::flush_impl(
7373
pCreate.path = name;
7474
IOHandler()->enqueue(IOTask(this, pCreate));
7575
for (auto &comp : *this)
76+
{
7677
comp.second.parent() = getWritable(this);
78+
comp.second.flush(comp.first, flushParams);
79+
}
7780
}
7881
}
79-
80-
if (scalar())
82+
else
8183
{
82-
for (auto &comp : *this)
84+
85+
if (scalar())
8386
{
84-
comp.second.flush(name, flushParams);
85-
writable().abstractFilePosition =
86-
comp.second.writable().abstractFilePosition;
87+
for (auto &comp : *this)
88+
{
89+
comp.second.flush(name, flushParams);
90+
writable().abstractFilePosition =
91+
comp.second.writable().abstractFilePosition;
92+
}
93+
}
94+
else
95+
{
96+
for (auto &comp : *this)
97+
comp.second.flush(comp.first, flushParams);
8798
}
88-
}
89-
else
90-
{
91-
for (auto &comp : *this)
92-
comp.second.flush(comp.first, flushParams);
9399
}
94100

95101
flushAttributes(flushParams);

0 commit comments

Comments
 (0)