Accessing a moved object. Also this method create an unused "out" variable by removing from the parameter. I guess It should update the parameter object? Anyway, seems very wrong (cherry picked from commit 534792e249da3efb83a62279f532b6690d028592) Co-authored-by: Merill <merill@free.fr>
This commit is contained in:
parent
89cf7f87bf
commit
4f9e946dfb
1 changed files with 3 additions and 2 deletions
|
@ -1910,14 +1910,15 @@ static inline void improve_ordering_by_two_exchanges_with_segment_flipping(Polyl
|
|||
for (const FlipEdge &edge : edges) {
|
||||
Polyline &pl = polylines[edge.source_index];
|
||||
out.emplace_back(std::move(pl));
|
||||
if (edge.p2 == pl.first_point().cast<double>()) {
|
||||
if (edge.p2 == out.back().first_point().cast<double>()) {
|
||||
// Polyline is flipped.
|
||||
out.back().reverse();
|
||||
} else {
|
||||
// Polyline is not flipped.
|
||||
assert(edge.p1 == pl.first_point().cast<double>());
|
||||
assert(edge.p1 == out.back().first_point().cast<double>());
|
||||
}
|
||||
}
|
||||
polylines = out;
|
||||
|
||||
#ifndef NDEBUG
|
||||
double cost_final = cost();
|
||||
|
|
Loading…
Reference in a new issue