File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99#[ macro_use]
1010mod zipmacro;
1111
12+ use std:: mem:: MaybeUninit ;
13+
1214use crate :: imp_prelude:: * ;
1315use crate :: AssignElem ;
1416use crate :: IntoDimension ;
@@ -737,6 +739,12 @@ where
737739 self . dimension [ unroll_axis] = inner_len;
738740 FoldWhile :: Continue ( acc)
739741 }
742+
743+ pub ( crate ) fn uninitalized_for_current_layout < T > ( & self ) -> Array < MaybeUninit < T > , D >
744+ {
745+ let is_f = !self . layout . is ( CORDER ) && self . layout . is ( FORDER ) ;
746+ Array :: maybe_uninit ( self . dimension . clone ( ) . set_f ( is_f) )
747+ }
740748}
741749
742750/*
@@ -997,9 +1005,7 @@ macro_rules! map_impl {
9971005 {
9981006 // To support non-Copy elements, implementation of dropping partial array (on
9991007 // panic) is needed
1000- let is_c = self . layout. is( CORDER ) ;
1001- let is_f = !is_c && self . layout. is( FORDER ) ;
1002- let mut output = Array :: maybe_uninit( self . dimension. clone( ) . set_f( is_f) ) ;
1008+ let mut output = self . uninitalized_for_current_layout:: <R >( ) ;
10031009 self . apply_assign_into( & mut output, f) ;
10041010 unsafe {
10051011 output. assume_init( )
You can’t perform that action at this time.
0 commit comments