@@ -396,18 +396,19 @@ impl<A, D> Array<A, D>
396
396
}
397
397
398
398
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) ;
401
403
402
404
if remaining_shape != array_rem_shape {
403
405
return Err ( ShapeError :: from_kind ( ErrorKind :: IncompatibleShape ) ) ;
404
406
}
405
407
406
408
let len_to_append = array. len ( ) ;
407
409
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 ( ) ] ;
411
412
let new_len = dimension:: size_of_shape_checked ( & res_dim) ?;
412
413
413
414
if len_to_append == 0 {
@@ -526,7 +527,7 @@ impl<A, D> Array<A, D>
526
527
527
528
// With > 0 strides, the current end of data is the correct base pointer for tail_view
528
529
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) ;
530
531
531
532
if tail_view. ndim ( ) > 1 {
532
533
sort_axes_in_default_order_tandem ( & mut tail_view, & mut array) ;
0 commit comments