Skip to content

Commit 32a50ba

Browse files
committed
Avoid copying
1 parent 06e04f3 commit 32a50ba

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/geom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void split_linestring(linestring_t const &line, double split_at,
6464
osmium::geom::Coordinates prev_pt{};
6565
out->emplace_back();
6666

67-
for (auto const this_pt : line) {
67+
for (auto const &this_pt : line) {
6868
if (prev_pt.valid()) {
6969
double const delta = distance(prev_pt, this_pt);
7070

src/geom.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ operator<<(std::basic_ostream<TChar, TTraits> &out, const linestring_t &line)
116116
out << "LINESTRING(";
117117

118118
bool first = true;
119-
for (auto const coord : line) {
119+
for (auto const &coord : line) {
120120
if (first) {
121121
first = false;
122122
} else {

0 commit comments

Comments
 (0)