@@ -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) ;
@@ -531,10 +539,17 @@ impl RegionDomain {
531539 }
532540
533541 pub fn push ( & mut self , id : RegionId , segment_range : std:: ops:: RangeInclusive < SegmentId > , fill : FillId ) {
542+ #[ cfg( debug_assertions) ]
534543 if self . id . contains ( & id) {
535- warn ! ( "Duplicate region" ) ;
544+ warn ! ( "Tried to push a duplicate region to a region domain " ) ;
536545 return ;
537546 }
547+
548+ self . push_unchecked ( id, segment_range, fill) ;
549+ }
550+
551+ #[ inline( always) ]
552+ pub fn push_unchecked ( & mut self , id : RegionId , segment_range : std:: ops:: RangeInclusive < SegmentId > , fill : FillId ) {
538553 self . id . push ( id) ;
539554 self . segment_range . push ( segment_range) ;
540555 self . fill . push ( fill) ;
0 commit comments