Skip to content

Commit 89f4b0b

Browse files
committed
Remove osmdata_t::start() function, do its job in constructor
1 parent eb8ac61 commit 89f4b0b

File tree

5 files changed

+1
-21
lines changed

5 files changed

+1
-21
lines changed

src/osm2pgsql.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ static file_info run(options_t const &options)
6161

6262
osmdata_t osmdata{middle, output, options};
6363

64-
osmdata.start();
65-
6664
// Processing: In this phase the input file(s) are read and parsed,
6765
// populating some of the tables.
6866
auto finfo = process_files(files, &osmdata, options.append,

src/osmdata.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ osmdata_t::osmdata_t(std::shared_ptr<middle_t> mid,
3535
{
3636
assert(m_mid);
3737
assert(m_output);
38+
m_output->start();
3839
}
3940

4041
void osmdata_t::node(osmium::Node const &node)
@@ -188,11 +189,6 @@ void osmdata_t::after_relations()
188189
m_output->sync();
189190
}
190191

191-
void osmdata_t::start() const
192-
{
193-
m_output->start();
194-
}
195-
196192
namespace {
197193

198194
/**

src/osmdata.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class osmdata_t : public osmium::handler::Handler
4444
osmdata_t(std::shared_ptr<middle_t> mid, std::shared_ptr<output_t> output,
4545
options_t const &options);
4646

47-
void start() const;
48-
4947
void node(osmium::Node const &node);
5048
void way(osmium::Way &way);
5149
void relation(osmium::Relation const &rel);

tests/common-import.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ inline void parse_file(options_t const &options,
4040
{
4141
osmdata_t osmdata{mid, output, options};
4242

43-
osmdata.start();
44-
4543
std::string filepath{TESTDATA_DIR};
4644
if (filename) {
4745
filepath += filename;
@@ -145,8 +143,6 @@ class import_t
145143

146144
osmdata_t osmdata{middle, output, options};
147145

148-
osmdata.start();
149-
150146
std::vector<osmium::io::File> files;
151147
for (auto const &data : input_data) {
152148
files.emplace_back(data.data(), data.size(), format);

tests/test-middle.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
10481048
thread_pool, options);
10491049
osmdata_t osmdata{mid, output, options};
10501050

1051-
osmdata.start();
1052-
10531051
osmdata.node(node10);
10541052
osmdata.node(node11);
10551053
osmdata.node(node12);
@@ -1084,7 +1082,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
10841082
thread_pool, options);
10851083
osmdata_t osmdata{mid, output, options};
10861084

1087-
osmdata.start();
10881085
osmdata.node(node10d);
10891086
osmdata.node(node10a);
10901087
osmdata.after_nodes();
@@ -1119,7 +1116,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
11191116
auto output = std::make_shared<output_null_t>(
11201117
mid->get_query_instance(), thread_pool, options);
11211118
osmdata_t osmdata{mid, output, options};
1122-
osmdata.start();
11231119

11241120
osmdata.node(node10d);
11251121
osmdata.node(node10a);
@@ -1147,7 +1143,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
11471143
auto output = std::make_shared<output_null_t>(
11481144
mid->get_query_instance(), thread_pool, options);
11491145
osmdata_t osmdata{mid, output, options};
1150-
osmdata.start();
11511146

11521147
osmdata.after_nodes();
11531148
osmdata.way(way20d);
@@ -1166,7 +1161,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
11661161
auto output = std::make_shared<output_null_t>(
11671162
mid->get_query_instance(), thread_pool, options);
11681163
osmdata_t osmdata{mid, output, options};
1169-
osmdata.start();
11701164

11711165
osmdata.node(node10d);
11721166
osmdata.node(node10a);
@@ -1236,7 +1230,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in relation", "", options_slim_default,
12361230
auto output = std::make_shared<output_null_t>(mid->get_query_instance(),
12371231
thread_pool, options);
12381232
osmdata_t osmdata{mid, output, options};
1239-
osmdata.start();
12401233

12411234
osmdata.node(node10d);
12421235
osmdata.node(node10a);
@@ -1259,7 +1252,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in relation", "", options_slim_default,
12591252
auto output = std::make_shared<output_null_t>(mid->get_query_instance(),
12601253
thread_pool, options);
12611254
osmdata_t osmdata{mid, output, options};
1262-
osmdata.start();
12631255

12641256
osmdata.node(node11d);
12651257
osmdata.node(node11a);

0 commit comments

Comments
 (0)