Skip to content

Commit 14d4b33

Browse files
committed
Small formatting fixes and cleanups
1 parent afddddf commit 14d4b33

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/osm2pgsql.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
7070
auto const outputs =
7171
output_t::create_outputs(middle->get_query_instance(), options);
7272
//let osmdata orchestrate between the middle and the outs
73-
osmdata_t osmdata(middle, outputs);
73+
osmdata_t osmdata{middle, outputs};
7474

7575
fmt::print(stderr, "Using projection SRS {} ({})\n",
7676
options.projection->target_srs(),

src/osmdata.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ osmdata_t::osmdata_t(std::shared_ptr<middle_t> mid,
2121
std::vector<std::shared_ptr<output_t>> const &outs)
2222
: m_mid(mid), m_outs(outs)
2323
{
24+
assert(m_mid);
25+
2426
if (m_outs.empty()) {
25-
throw std::runtime_error{"Must have at least one output, but none have "
26-
"been configured."};
27+
throw std::runtime_error{"Must have at least one output, "
28+
"but none have been configured."};
2729
}
2830

31+
// Get the "extra_attributes" option from the first output. We expect
32+
// all others to be the same.
2933
m_with_extra_attrs = m_outs[0]->get_options()->extra_attributes;
3034
}
3135

@@ -450,8 +454,8 @@ void osmdata_t::stop() const
450454
// Clustering, index creation, and cleanup.
451455
// All the intensive parts of this are long-running PostgreSQL commands
452456
{
453-
osmium::thread::Pool pool(opts->parallel_indexing ? opts->num_procs : 1,
454-
512);
457+
osmium::thread::Pool pool{opts->parallel_indexing ? opts->num_procs : 1,
458+
512};
455459

456460
if (opts->droptemp) {
457461
// When dropping middle tables, make sure they are gone before

tests/common-import.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inline void parse_file(options_t const &options,
2626
char const *filename = nullptr)
2727
{
2828
//let osmdata orchestrate between the middle and the outs
29-
osmdata_t osmdata(mid, outs);
29+
osmdata_t osmdata{mid, outs};
3030

3131
osmdata.start();
3232
parse_osmium_t parser(options.bbox, options.append, &osmdata);
@@ -84,7 +84,7 @@ class import_t
8484
output_t::create_outputs(middle->get_query_instance(), options);
8585

8686
//let osmdata orchestrate between the middle and the outs
87-
osmdata_t osmdata(middle, outputs);
87+
osmdata_t osmdata{middle, outputs};
8888

8989
osmdata.start();
9090

0 commit comments

Comments
 (0)