@@ -100,8 +100,6 @@ pub(super) fn filter_slice_by_bitmap<T: Copy>(slice: &[T], mask: &MaskValues) ->
100100
101101/// Filter a slice by a set of strictly increasing indices.
102102pub ( super ) fn filter_slice_by_indices < T : Copy > ( slice : & [ T ] , indices : & [ usize ] ) -> Buffer < T > {
103- debug_assert ! ( indices. last( ) . is_none_or( |& index| index < slice. len( ) ) ) ;
104-
105103 let mut out = BufferMut :: < T > :: with_capacity ( indices. len ( ) ) ;
106104 let src_ptr = slice. as_ptr ( ) ;
107105 let out_ptr = out. spare_capacity_mut ( ) . as_mut_ptr ( ) . cast :: < T > ( ) ;
@@ -123,10 +121,6 @@ pub(super) fn filter_slice_by_slices<T: Copy>(
123121 slices : & [ ( usize , usize ) ] ,
124122 output_len : usize ,
125123) -> Buffer < T > {
126- debug_assert_eq ! (
127- output_len,
128- slices. iter( ) . map( |( start, end) | end - start) . sum:: <usize >( )
129- ) ;
130124 let mut out = BufferMut :: < T > :: with_capacity ( output_len) ;
131125 for ( start, end) in slices {
132126 out. extend_from_slice ( & slice[ * start..* end] ) ;
@@ -181,8 +175,6 @@ pub(super) fn filter_slice_mut_by_bitmap<T: Copy>(slice: &mut [T], mask: &MaskVa
181175
182176/// Filter a mutable slice in-place by strictly increasing indices.
183177pub ( super ) fn filter_slice_mut_by_indices < T : Copy > ( slice : & mut [ T ] , indices : & [ usize ] ) -> usize {
184- debug_assert ! ( indices. last( ) . is_none_or( |& index| index < slice. len( ) ) ) ;
185-
186178 let ptr = slice. as_mut_ptr ( ) ;
187179 for ( write_pos, & index) in indices. iter ( ) . enumerate ( ) {
188180 if write_pos != index {
0 commit comments