Skip to content

Commit d4e2e64

Browse files
committed
Remove second parameter of pending_way/relation
1 parent 2c9a62b commit d4e2e64

File tree

10 files changed

+26
-37
lines changed

10 files changed

+26
-37
lines changed

src/osmdata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ struct pending_threaded_processor : public pending_processor
195195

196196
//process it
197197
if (ways) {
198-
outputs.at(job.output_id)->pending_way(job.osm_id, true);
198+
outputs.at(job.output_id)->pending_way(job.osm_id);
199199
} else {
200-
outputs.at(job.output_id)->pending_relation(job.osm_id, true);
200+
outputs.at(job.output_id)->pending_relation(job.osm_id);
201201
}
202202
}
203203
}

src/output-flex.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ void output_flex_t::call_process_function(int index,
10071007
}
10081008
}
10091009

1010-
void output_flex_t::pending_way(osmid_t id, bool exists)
1010+
void output_flex_t::pending_way(osmid_t id)
10111011
{
10121012
if (!m_has_process_way) {
10131013
return;
@@ -1018,9 +1018,7 @@ void output_flex_t::pending_way(osmid_t id, bool exists)
10181018
return;
10191019
}
10201020

1021-
if (exists) {
1022-
way_delete(id);
1023-
}
1021+
way_delete(id);
10241022

10251023
auto &way = m_buffer.get<osmium::Way>(0);
10261024

@@ -1031,7 +1029,7 @@ void output_flex_t::pending_way(osmid_t id, bool exists)
10311029
m_buffer.clear();
10321030
}
10331031

1034-
void output_flex_t::pending_relation(osmid_t id, bool exists)
1032+
void output_flex_t::pending_relation(osmid_t id)
10351033
{
10361034
if (!m_has_process_relation) {
10371035
return;
@@ -1045,10 +1043,7 @@ void output_flex_t::pending_relation(osmid_t id, bool exists)
10451043
return;
10461044
}
10471045

1048-
// If the flag says this object may exist already, delete it first.
1049-
if (exists) {
1050-
delete_from_tables(osmium::item_type::relation, id);
1051-
}
1046+
delete_from_tables(osmium::item_type::relation, id);
10521047

10531048
auto const &relation = m_rels_buffer.get<osmium::Relation>(0);
10541049

src/output-flex.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class output_flex_t : public output_t
6161

6262
void stage2_proc() override;
6363

64-
void pending_way(osmid_t id, bool exists) override;
65-
void pending_relation(osmid_t id, bool exists) override;
64+
void pending_way(osmid_t id) override;
65+
void pending_relation(osmid_t id) override;
6666

6767
void node_add(osmium::Node const &node) override;
6868
void way_add(osmium::Way *way) override;

src/output-gazetteer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class output_gazetteer_t : public output_t
4747

4848
bool need_forward_dependencies() const noexcept override { return false; }
4949

50-
void pending_way(osmid_t, bool) noexcept override {}
51-
void pending_relation(osmid_t, bool) noexcept override {}
50+
void pending_way(osmid_t) noexcept override {}
51+
void pending_relation(osmid_t) noexcept override {}
5252

5353
void node_add(osmium::Node const &node) override;
5454
void way_add(osmium::Way *way) override;

src/output-multi.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ void output_multi_t::start()
6565
m_options.tblsmain_data);
6666
}
6767

68-
void output_multi_t::pending_way(osmid_t id, bool exists)
68+
void output_multi_t::pending_way(osmid_t id)
6969
{
7070
// Try to fetch the way from the DB
7171
buffer.clear();
7272
if (m_mid->way_get(id, buffer)) {
7373
// Output the way
74-
reprocess_way(&buffer.get<osmium::Way>(0), exists);
74+
reprocess_way(&buffer.get<osmium::Way>(0), true);
7575
}
7676
}
7777

78-
void output_multi_t::pending_relation(osmid_t id, bool exists)
78+
void output_multi_t::pending_relation(osmid_t id)
7979
{
8080
// Try to fetch the relation from the DB
8181
buffer.clear();
8282
if (m_mid->relation_get(id, buffer)) {
8383
auto const &rel = buffer.get<osmium::Relation>(0);
84-
process_relation(rel, exists);
84+
process_relation(rel, true);
8585
}
8686
}
8787

src/output-multi.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class output_multi_t : public output_t
4646
void stop(osmium::thread::Pool *pool) override;
4747
void commit() override;
4848

49-
void pending_way(osmid_t id, bool exists) override;
50-
void pending_relation(osmid_t id, bool exists) override;
49+
void pending_way(osmid_t id) override;
50+
void pending_relation(osmid_t id) override;
5151

5252
void node_add(osmium::Node const &node) override;
5353
void way_add(osmium::Way *way) override;

src/output-null.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class output_null_t : public output_t
2424

2525
bool need_forward_dependencies() const noexcept override { return false; }
2626

27-
void pending_way(osmid_t /*id*/, bool /*exists*/) override {}
28-
void pending_relation(osmid_t /*id*/, bool /*exists*/) override {}
27+
void pending_way(osmid_t) override {}
28+
void pending_relation(osmid_t) override {}
2929

3030
void node_add(osmium::Node const & /*node*/) override {}
3131
void way_add(osmium::Way * /*way*/) override {}

src/output-pgsql.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,12 @@ void output_pgsql_t::pgsql_out_way(osmium::Way const &way, taglist_t *tags,
6666
}
6767
}
6868

69-
void output_pgsql_t::pending_way(osmid_t id, bool exists)
69+
void output_pgsql_t::pending_way(osmid_t id)
7070
{
7171
// Try to fetch the way from the DB
7272
buffer.clear();
7373
if (m_mid->way_get(id, buffer)) {
74-
/* If the flag says this object may exist already, delete it first */
75-
if (exists) {
76-
pgsql_delete_way_from_output(id);
77-
}
74+
pgsql_delete_way_from_output(id);
7875

7976
taglist_t outtags;
8077
int polygon;
@@ -90,18 +87,15 @@ void output_pgsql_t::pending_way(osmid_t id, bool exists)
9087
}
9188
}
9289

93-
void output_pgsql_t::pending_relation(osmid_t id, bool exists)
90+
void output_pgsql_t::pending_relation(osmid_t id)
9491
{
9592
// Try to fetch the relation from the DB
9693
// Note that we cannot use the global buffer here because
9794
// we cannot keep a reference to the relation and an autogrow buffer
9895
// might be relocated when more data is added.
9996
rels_buffer.clear();
10097
if (m_mid->relation_get(id, rels_buffer)) {
101-
// If the flag says this object may exist already, delete it first.
102-
if (exists) {
103-
pgsql_delete_relation_from_output(id);
104-
}
98+
pgsql_delete_relation_from_output(id);
10599

106100
auto const &rel = rels_buffer.get<osmium::Relation>(0);
107101
pgsql_process_relation(rel);

src/output-pgsql.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class output_pgsql_t : public output_t
4646
void stop(osmium::thread::Pool *pool) override;
4747
void commit() override;
4848

49-
void pending_way(osmid_t id, bool exists) override;
50-
void pending_relation(osmid_t id, bool exists) override;
49+
void pending_way(osmid_t id) override;
50+
void pending_relation(osmid_t id) override;
5151

5252
void node_add(osmium::Node const &node) override;
5353
void way_add(osmium::Way *way) override;

src/output.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class output_t
4040

4141
virtual bool need_forward_dependencies() const noexcept { return true; }
4242

43-
virtual void pending_way(osmid_t id, bool exists) = 0;
44-
virtual void pending_relation(osmid_t id, bool exists) = 0;
43+
virtual void pending_way(osmid_t id) = 0;
44+
virtual void pending_relation(osmid_t id) = 0;
4545

4646
virtual void node_add(osmium::Node const &node) = 0;
4747
virtual void way_add(osmium::Way *way) = 0;

0 commit comments

Comments
 (0)