Skip to content

Commit 45c2207

Browse files
committed
Move commiting of clones into process_queue()
This not only consolidates common code, it also has the effect of moving the commit inside the code covered by the timer, which should result in more realistic timer numbers.
1 parent 7859fb7 commit 45c2207

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/osmdata.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ struct pending_threaded_processor : public pending_processor
272272
throw;
273273
}
274274
}
275+
276+
for (auto const &clone : m_clones) {
277+
for (auto const &clone_output : clone) {
278+
clone_output->commit();
279+
}
280+
}
275281
}
276282

277283
void process_ways() override
@@ -293,12 +299,6 @@ struct pending_threaded_processor : public pending_processor
293299
stderr, "{} Pending ways took {}s at a rate of {:.2f}/s\n",
294300
ids_queued, timer.elapsed(), timer.per_second(ids_queued));
295301
}
296-
297-
for (auto const &clone : m_clones) {
298-
for (auto const &clone_output : clone) {
299-
clone_output.get()->commit();
300-
}
301-
}
302302
}
303303

304304
void process_relations() override
@@ -329,8 +329,6 @@ struct pending_threaded_processor : public pending_processor
329329
original_output != m_outputs.end() &&
330330
clone_output != clone.end();
331331
++original_output, ++clone_output) {
332-
//done copying rels for now
333-
clone_output->get()->commit();
334332
//merge the expire tree from this threads copy of output back
335333
original_output->get()->merge_expire_trees(clone_output->get());
336334
}

0 commit comments

Comments
 (0)