Skip to content

Commit 5023090

Browse files
committed
ids_queued doesn't need to be a member variable
1 parent 46b11fa commit 5023090

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/osmdata.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct pending_threaded_processor : public pending_processor
223223
//note that we cant hint to the stack how large it should be ahead of time
224224
//we could use a different datastructure like a deque or vector but then
225225
//the outputs the enqueue jobs would need the version check for the push(_back) method
226-
: outs(outs), ids_queued(0), append(append), queue()
226+
: outs(outs), append(append), queue()
227227
{
228228

229229
//clone all the things we need
@@ -249,14 +249,15 @@ struct pending_threaded_processor : public pending_processor
249249
for (size_t i = 0; i < outs.size(); ++i) {
250250
if (outs[i]->need_forward_dependencies()) {
251251
queue.emplace(id, i);
252-
++ids_queued;
253252
}
254253
}
255254
}
256255

257256
//waits for the completion of all outstanding jobs
258257
void process_ways() override
259258
{
259+
auto const ids_queued = queue.size();
260+
260261
fmt::print(stderr, "\nGoing over pending ways...\n");
261262
fmt::print(stderr, "\t{} ways are pending\n", ids_queued);
262263
fmt::print(stderr, "\nUsing {} helper-processes\n", clones.size());
@@ -294,7 +295,6 @@ struct pending_threaded_processor : public pending_processor
294295
stderr, "{} Pending ways took {}s at a rate of {:.2f}/s\n",
295296
ids_queued, timer.elapsed(), timer.per_second(ids_queued));
296297
}
297-
ids_queued = 0;
298298

299299
for (auto const &clone : clones) {
300300
for (auto const &clone_output : clone) {
@@ -308,13 +308,14 @@ struct pending_threaded_processor : public pending_processor
308308
for (size_t i = 0; i < outs.size(); ++i) {
309309
if (outs[i]->need_forward_dependencies()) {
310310
queue.emplace(id, i);
311-
++ids_queued;
312311
}
313312
}
314313
}
315314

316315
void process_relations() override
317316
{
317+
auto const ids_queued = queue.size();
318+
318319
fmt::print(stderr, "\nGoing over pending relations...\n");
319320
fmt::print(stderr, "\t{} relations are pending\n", ids_queued);
320321
fmt::print(stderr, "\nUsing {} helper-processes\n", clones.size());
@@ -352,7 +353,6 @@ struct pending_threaded_processor : public pending_processor
352353
stderr, "{} Pending relations took {}s at a rate of {:.2f}/s\n",
353354
ids_queued, timer.elapsed(), timer.per_second(ids_queued));
354355
}
355-
ids_queued = 0;
356356

357357
//collect all expiry tree informations together into one
358358
for (auto const &clone : clones) {
@@ -374,8 +374,6 @@ struct pending_threaded_processor : public pending_processor
374374
std::vector<output_vec_t> clones;
375375
output_vec_t
376376
outs; //would like to move ownership of outs to osmdata_t and middle passed to output_t instead of owned by it
377-
//how many jobs do we have in the queue to start with
378-
size_t ids_queued;
379377
//appending to output that is already there (diff processing)
380378
bool append;
381379
//job queue

0 commit comments

Comments
 (0)