Skip to content

Commit 665a484

Browse files
authored
Merge pull request #900 from lonvia/skip-pending-when-nothing-to-process
Skip processing stage entirely when no objects are pending
2 parents 821775e + bb00076 commit 665a484

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

osmdata.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,13 @@ void osmdata_t::stop() {
422422
// should be the same for all outputs
423423
auto *opts = outs[0]->get_options();
424424

425-
{
425+
// are there any objects left pending?
426+
bool has_pending = mid->pending_count() > 0;
427+
for (auto const &out : outs) {
428+
has_pending |= out->pending_count() > 0;
429+
}
430+
431+
if (has_pending) {
426432
//threaded pending processing
427433
pending_threaded_processor ptp(mid, outs, opts->num_procs,
428434
opts->append);

0 commit comments

Comments
 (0)