Skip to content

Commit 236e1eb

Browse files
committed
Adapt parameter type to use case
* Use value parameters and std::move for parameters we copy * Use const & for parameters we only look at
1 parent ec529b9 commit 236e1eb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/osmdata.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919

2020
osmdata_t::osmdata_t(std::unique_ptr<dependency_manager_t> dependency_manager,
2121
std::shared_ptr<middle_t> mid,
22-
std::vector<std::shared_ptr<output_t>> const &outs)
23-
: m_dependency_manager(std::move(dependency_manager)), m_mid(mid), m_outs(outs)
22+
std::vector<std::shared_ptr<output_t>> outs)
23+
: m_dependency_manager(std::move(dependency_manager)), m_mid(std::move(mid)),
24+
m_outs(std::move(outs))
2425
{
2526
assert(m_dependency_manager);
2627
assert(m_mid);
@@ -173,11 +174,11 @@ class multithreaded_processor
173174
public:
174175
using output_vec_t = std::vector<std::shared_ptr<output_t>>;
175176

176-
multithreaded_processor(std::shared_ptr<middle_t> mid,
177-
output_vec_t const &outs, size_t thread_count)
178-
: m_outputs(outs)
177+
multithreaded_processor(std::shared_ptr<middle_t> const &mid,
178+
output_vec_t outs, size_t thread_count)
179+
: m_outputs(std::move(outs))
179180
{
180-
assert(!outs.empty());
181+
assert(!m_outputs.empty());
181182

182183
// The database connection info should be the same for all outputs,
183184
// we take it arbitrarily from the first.

src/osmdata.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class osmdata_t
1616
public:
1717
osmdata_t(std::unique_ptr<dependency_manager_t> dependency_manager,
1818
std::shared_ptr<middle_t> mid,
19-
std::vector<std::shared_ptr<output_t>> const &outs);
19+
std::vector<std::shared_ptr<output_t>> outs);
2020

2121
void start() const;
2222
void flush() const;

0 commit comments

Comments
 (0)