Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace partial_cmp with total_cmp in sorting #1218

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion geo/src/algorithm/interior_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn polygon_interior_point_with_segment_length<T: GeoFloat>(
let midpoint = Point::new((start.x + end.x) / two, y_mid);
segments.push((midpoint, length));
}
segments.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(Ordering::Less));
segments.sort_by(|a, b| b.1.total_cmp(&a.1));

for (midpoint, segment_length) in segments {
// some pairs of consecutive points traveling east-west will bound segments inside the
Expand Down
Loading