@@ -396,18 +396,19 @@ impl<A, D> Array<A, D>
396396 }
397397
398398 let current_axis_len = self . len_of ( axis) ;
399- let remaining_shape = self . raw_dim ( ) . remove_axis ( axis) ;
400- let array_rem_shape = array. raw_dim ( ) . remove_axis ( axis) ;
399+ let self_dim = self . raw_dim ( ) ;
400+ let array_dim = array. raw_dim ( ) ;
401+ let remaining_shape = self_dim. remove_axis ( axis) ;
402+ let array_rem_shape = array_dim. remove_axis ( axis) ;
401403
402404 if remaining_shape != array_rem_shape {
403405 return Err ( ShapeError :: from_kind ( ErrorKind :: IncompatibleShape ) ) ;
404406 }
405407
406408 let len_to_append = array. len ( ) ;
407409
408- let array_shape = array. raw_dim ( ) ;
409- let mut res_dim = self . raw_dim ( ) ;
410- res_dim[ axis. index ( ) ] += array_shape[ axis. index ( ) ] ;
410+ let mut res_dim = self_dim;
411+ res_dim[ axis. index ( ) ] += array_dim[ axis. index ( ) ] ;
411412 let new_len = dimension:: size_of_shape_checked ( & res_dim) ?;
412413
413414 if len_to_append == 0 {
@@ -526,7 +527,7 @@ impl<A, D> Array<A, D>
526527
527528 // With > 0 strides, the current end of data is the correct base pointer for tail_view
528529 let tail_ptr = self . data . as_end_nonnull ( ) ;
529- let mut tail_view = RawArrayViewMut :: new ( tail_ptr, array_shape , tail_strides) ;
530+ let mut tail_view = RawArrayViewMut :: new ( tail_ptr, array_dim , tail_strides) ;
530531
531532 if tail_view. ndim ( ) > 1 {
532533 sort_axes_in_default_order_tandem ( & mut tail_view, & mut array) ;
0 commit comments