@@ -129,14 +129,16 @@ impl PointDomain {
129129 }
130130
131131 pub fn push ( & mut self , id : PointId , position : DVec2 ) {
132+ #[ cfg( debug_assertions) ]
132133 if self . id . contains ( & id) {
134+ warn ! ( "Tried to push a duplicate point to a point domain" ) ;
133135 return ;
134136 }
135137
136- self . id . push ( id) ;
137- self . position . push ( position) ;
138+ self . push_unchecked ( id, position) ;
138139 }
139140
141+ #[ inline( always) ]
140142 pub fn push_unchecked ( & mut self , id : PointId , position : DVec2 ) {
141143 self . id . push ( id) ;
142144 self . position . push ( position) ;
@@ -316,9 +318,15 @@ impl SegmentDomain {
316318 pub fn push ( & mut self , id : SegmentId , start : usize , end : usize , handles : BezierHandles , stroke : StrokeId ) {
317319 #[ cfg( debug_assertions) ]
318320 if self . id . contains ( & id) {
319- warn ! ( "Tried to push an existing point to a point domain" ) ;
321+ warn ! ( "Tried to push a duplicate segment to a segment domain" ) ;
322+ return ;
320323 }
321324
325+ self . push_unchecked ( id, start, end, handles, stroke) ;
326+ }
327+
328+ #[ inline( always) ]
329+ pub fn push_unchecked ( & mut self , id : SegmentId , start : usize , end : usize , handles : BezierHandles , stroke : StrokeId ) {
322330 self . id . push ( id) ;
323331 self . start_point . push ( start) ;
324332 self . end_point . push ( end) ;
@@ -618,10 +626,17 @@ impl RegionDomain {
618626 }
619627
620628 pub fn push ( & mut self , id : RegionId , segment_range : std:: ops:: RangeInclusive < SegmentId > , fill : FillId ) {
629+ #[ cfg( debug_assertions) ]
621630 if self . id . contains ( & id) {
622- warn ! ( "Duplicate region" ) ;
631+ warn ! ( "Tried to push a duplicate region to a region domain " ) ;
623632 return ;
624633 }
634+
635+ self . push_unchecked ( id, segment_range, fill) ;
636+ }
637+
638+ #[ inline( always) ]
639+ pub fn push_unchecked ( & mut self , id : RegionId , segment_range : std:: ops:: RangeInclusive < SegmentId > , fill : FillId ) {
625640 self . id . push ( id) ;
626641 self . segment_range . push ( segment_range) ;
627642 self . fill . push ( fill) ;
0 commit comments