Skip to content

Commit 235c911

Browse files
committed
Remove ways_pending_tracker from multi output
1 parent 94f4007 commit 235c911

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

src/output-multi.cpp

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,47 +67,16 @@ void output_multi_t::start()
6767

6868
bool output_multi_t::has_pending() const
6969
{
70-
return !ways_pending_tracker.empty() || !rels_pending_tracker.empty();
70+
return !rels_pending_tracker.empty();
7171
}
7272

7373
void output_multi_t::enqueue_ways(pending_queue_t &job_queue, osmid_t id,
7474
size_t output_id, size_t &added)
7575
{
76-
osmid_t const prev = ways_pending_tracker.last_returned();
77-
if (id_tracker::is_valid(prev) && prev >= id) {
78-
if (prev > id) {
79-
job_queue.push(pending_job_t(id, output_id));
80-
}
81-
// already done the job
82-
return;
83-
}
84-
85-
//make sure we get the one passed in
8676
if (id_tracker::is_valid(id)) {
87-
job_queue.push(pending_job_t(id, output_id));
77+
job_queue.emplace(id, output_id);
8878
++added;
8979
}
90-
91-
//grab the first one or bail if its not valid
92-
osmid_t popped = ways_pending_tracker.pop_mark();
93-
if (!id_tracker::is_valid(popped)) {
94-
return;
95-
}
96-
97-
//get all the ones up to the id that was passed in
98-
while (popped < id) {
99-
job_queue.push(pending_job_t(popped, output_id));
100-
++added;
101-
popped = ways_pending_tracker.pop_mark();
102-
}
103-
104-
//make sure to get this one as well and move to the next
105-
if (popped > id) {
106-
if (id_tracker::is_valid(popped)) {
107-
job_queue.push(pending_job_t(popped, output_id));
108-
++added;
109-
}
110-
}
11180
}
11281

11382
void output_multi_t::pending_way(osmid_t id, int exists)
@@ -324,15 +293,7 @@ void output_multi_t::process_way(osmium::Way *way)
324293
auto const geom = m_processor->process_way(*way, &m_builder);
325294

326295
if (!geom.empty()) {
327-
//if we are also interested in relations we need to mark
328-
//this way pending just in case it shows up in one
329-
if (m_processor->interests(geometry_processor::interest_relation)) {
330-
ways_pending_tracker.mark(way->id());
331-
} else {
332-
// We wouldn't be interested in this as a relation, so no need to mark it pending.
333-
// TODO: Does this imply anything for non-multipolygon relations?
334-
copy_to_table(way->id(), geom, outtags);
335-
}
296+
copy_to_table(way->id(), geom, outtags);
336297
}
337298
}
338299
}

src/output-multi.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class output_multi_t : public output_t
8787
std::shared_ptr<reprojection> m_proj;
8888
osmium::item_type const m_osm_type;
8989
std::unique_ptr<table_t> m_table;
90-
id_tracker ways_pending_tracker, rels_pending_tracker;
90+
id_tracker rels_pending_tracker;
9191
expire_tiles m_expire;
9292
relation_helper m_relation_helper;
9393
osmium::memory::Buffer buffer;

0 commit comments

Comments
 (0)