Skip to content

Commit 60987b4

Browse files
committed
Remove potentially expensive copy operator from idlist_t
And fix the unnecessary copy this found.
1 parent 3c1257e commit 60987b4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/idlist.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@ class idlist_t
2727
using value_type = osmid_t;
2828

2929
idlist_t() = default;
30+
~idlist_t() noexcept = default;
3031

3132
idlist_t(std::initializer_list<osmid_t> ids) : m_list(ids) {}
3233

34+
idlist_t(idlist_t const &) = delete;
35+
idlist_t &operator=(idlist_t const &) = delete;
36+
37+
idlist_t(idlist_t &&) = default;
38+
idlist_t &operator=(idlist_t &&) = default;
39+
3340
bool empty() const noexcept { return m_list.empty(); }
3441

3542
std::size_t size() const noexcept { return m_list.size(); }

src/osmdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ void osmdata_t::process_dependents() const
364364
}
365365

366366
// stage 1c processing: mark parent relations of marked objects as changed
367-
auto marked_ways = m_output->get_marked_way_ids();
367+
auto const &marked_ways = m_output->get_marked_way_ids();
368368
if (marked_ways.empty()) {
369369
return;
370370
}

0 commit comments

Comments
 (0)