mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 03:32:02 +08:00
Fix bug ShortestPath.cpp (#13331)
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
This commit is contained in:
parent
ae0824a10d
commit
534792e249
@ -1957,14 +1957,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…
x
Reference in New Issue
Block a user