Skip to content

Commit 14c1459

Browse files
committed
Fix distance bug: order by absolute distance
Signed-off-by: Tristram Gräbener <[email protected]>
1 parent c081ec3 commit 14c1459

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lrs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ impl<CurveImpl: Curve> LrsBase for Lrs<CurveImpl> {
521521
.collect();
522522
result.sort_by(|a, b| {
523523
a.orthogonal_offset
524-
.partial_cmp(&b.orthogonal_offset)
524+
.abs()
525+
.partial_cmp(&b.orthogonal_offset.abs())
525526
.unwrap_or(Ordering::Equal)
526527
});
527528
result

0 commit comments

Comments
 (0)