Skip to content

Commit

Permalink
Use lvalue reference instead of rvalue reference
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKutzner committed Oct 2, 2024
1 parent 3316b79 commit 0e7c20c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rt/frun.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ void frun::for_each_shape_point(
return absolute_range << stop_range_.from_;
};
auto consume_pos = [&callback, last_pos = geo::latlng{200, 200}](
geo::latlng const&& pos) mutable {
geo::latlng const& pos) mutable {
if (pos != last_pos) {
callback(pos);
}
last_pos = std::move(pos);
last_pos = pos;
};
// Range over all trips using absolute 'trip_details.offset_range_'
auto last_trip_index = trip_idx_t::invalid();
Expand All @@ -422,8 +422,8 @@ void frun::for_each_shape_point(
if (common_stops.size() > 1) {
std::visit(
utl::overloaded{[&](std::span<geo::latlng const> shape) {
for (auto const pos : shape) {
consume_pos(std::move(pos));
for (auto const& pos : shape) {
consume_pos(pos);
}
},
[&](stop_int relative_range) {
Expand Down

0 comments on commit 0e7c20c

Please sign in to comment.