Skip to content

Commit 5f2d9a4

Browse files
committed
Fix wrong seam issue
CURA-12250
1 parent 3ccf945 commit 5f2d9a4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils/scoring/BestElementFinder.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ std::vector<size_t> BestElementFinder::findBestElements(const size_t candidates_
3333
const auto begin = best_candidates.begin();
3434
auto end = best_candidates.end();
3535

36-
// Now run the criteria passes until we have a single outsider or no more cirteria
36+
// Now run the criteria passes until we have a single outsider or no more criteria
3737
for (const CriteriaPass& criteria_pass : criteria_)
3838
{
3939
// For each element, reset score, process each criterion and apply weights to get the global score
@@ -67,6 +67,13 @@ std::vector<size_t> BestElementFinder::findBestElements(const size_t candidates_
6767
}
6868
}
6969

70+
std::sort(
71+
begin,
72+
end,
73+
[](const Candidate& candidate1, const Candidate& candidate2)
74+
{
75+
return candidate1.score > candidate2.score;
76+
});
7077
std::vector<size_t> best_candidates_indices;
7178
best_candidates_indices.reserve(std::distance(begin, end));
7279
for (auto iterator = begin; iterator != end; ++iterator)

0 commit comments

Comments
 (0)