Improve `std::partition` predicate

This commit is contained in:
Clément Jamin 2021-11-16 15:48:48 +01:00 committed by GitHub
parent 597970b368
commit ffe7a6909a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -247,9 +247,9 @@ remove_outliers(
if (threshold_distance != FT(0))
f2r = std::partition (sorted_points.begin(), sorted_points.end(),
[&threshold_distance](const std::pair<FT, value_type>& p) -> bool
{
return p.first < threshold_distance * threshold_distance;
[sq_threshold_distance = CGAL::square(threshold_distance)](const std::pair<FT, value_type>& p) -> bool
{
return p.first < sq_threshold_distance;
});
if (static_cast<std::size_t>(std::distance (sorted_points.begin(), f2r)) < first_index_to_remove)