Skip to content

Commit 50f344c

Browse files
committed
Simplify enqueue_ways handling
1 parent 235c911 commit 50f344c

File tree

5 files changed

+6
-20
lines changed

5 files changed

+6
-20
lines changed

src/middle-pgsql.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ void middle_pgsql_t::iterate_ways(middle_t::pending_processor &pf)
445445
while (id_tracker::is_valid(id = m_ways_pending_tracker->pop_mark())) {
446446
pf.enqueue_ways(id);
447447
}
448-
// in case we had higher ones than the middle
449-
pf.enqueue_ways(id_tracker::max());
450448

451449
//let the threads work on them
452450
pf.process_ways();

src/output-flex.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,8 @@ void output_flex_t::call_process_function(int index,
10051005
void output_flex_t::enqueue_ways(pending_queue_t &job_queue, osmid_t id,
10061006
std::size_t output_id, std::size_t &added)
10071007
{
1008-
if (id_tracker::is_valid(id)) {
1009-
job_queue.emplace(id, output_id);
1010-
++added;
1011-
}
1008+
job_queue.emplace(id, output_id);
1009+
++added;
10121010
}
10131011

10141012
void output_flex_t::pending_way(osmid_t id, int exists)

src/output-multi.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,8 @@ bool output_multi_t::has_pending() const
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-
if (id_tracker::is_valid(id)) {
77-
job_queue.emplace(id, output_id);
78-
++added;
79-
}
76+
job_queue.emplace(id, output_id);
77+
++added;
8078
}
8179

8280
void output_multi_t::pending_way(osmid_t id, int exists)

src/output-pgsql.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ void output_pgsql_t::pgsql_out_way(osmium::Way const &way, taglist_t *tags,
6969
void output_pgsql_t::enqueue_ways(pending_queue_t &job_queue, osmid_t id,
7070
size_t output_id, size_t &added)
7171
{
72-
if (id_tracker::is_valid(id)) {
73-
job_queue.emplace(id, output_id);
74-
++added;
75-
}
72+
job_queue.emplace(id, output_id);
73+
++added;
7674
}
7775

7876
void output_pgsql_t::pending_way(osmid_t id, int exists)

tests/test-middle.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,12 +1018,6 @@ class test_pending_processor : public middle_t::pending_processor
10181018

10191019
void check_way_ids_equal_to(std::initializer_list<osmid_t> list) noexcept
10201020
{
1021-
REQUIRE(!m_way_ids.empty());
1022-
1023-
// The last tracked id is always the invalid id, which we ignore
1024-
REQUIRE_FALSE(id_tracker::is_valid(m_way_ids.back()));
1025-
m_way_ids.pop_back();
1026-
10271021
REQUIRE(m_way_ids.size() == list.size());
10281022
REQUIRE(std::equal(m_way_ids.cbegin(), m_way_ids.cend(), list.begin()));
10291023
}

0 commit comments

Comments
 (0)