File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ impl ContourDecomposition for IntContour {
4545 . map ( |( i, & p) | IdPoint :: new ( i, p) )
4646 . collect ( ) ;
4747
48- id_points. sort_by ( |p0, p1| p0. point . cmp ( & p1. point ) . then_with ( || p0. id . cmp ( & p1. id ) ) ) ;
48+ id_points. sort_unstable_by ( |p0, p1| p0. point . cmp ( & p1. point ) . then_with ( || p0. id . cmp ( & p1. id ) ) ) ;
4949
5050 let mut p0 = id_points. first ( ) . unwrap ( ) . point ;
5151 let mut anchors = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ impl OverlayGraph<'_> {
170170 }
171171
172172 if !anchors_already_sorted {
173- anchors. sort_by ( |s0, s1| s0. v_segment . a . cmp ( & s1. v_segment . a ) ) ;
173+ anchors. sort_unstable_by ( |s0, s1| s0. v_segment . a . cmp ( & s1. v_segment . a ) ) ;
174174 }
175175
176176 shapes. join_sorted_holes ( holes, anchors, clockwise) ;
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl OverlayGraph<'_> {
168168 }
169169
170170 if !anchors_already_sorted {
171- anchors. sort_by ( |s0, s1| s0. v_segment . a . cmp ( & s1. v_segment . a ) ) ;
171+ anchors. sort_unstable_by ( |s0, s1| s0. v_segment . a . cmp ( & s1. v_segment . a ) ) ;
172172 }
173173
174174 shapes. join_sorted_holes ( holes, anchors, is_main_dir_cw) ;
Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ impl SplitSolver {
108108 marks : Vec < LineMark > ,
109109 }
110110
111- let marks_capacity = self . marks . len ( ) / buffer. groups . len ( ) ;
111+ debug_assert ! ( !buffer. groups. is_empty( ) , "groups.len() >= 1" ) ;
112+ let marks_capacity = self . marks . capacity ( ) / buffer. groups . len ( ) ;
112113
113114 let results: Vec < TaskResult > = buffer
114115 . groups
You can’t perform that action at this time.
0 commit comments