Skip to content

Commit 6c636dc

Browse files
Access last element directly
1 parent d48c5a9 commit 6c636dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/arrayformat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn format_array<A, S, D, F>(view: &ArrayBase<S, D>,
3838
.collect();
3939

4040
let ndim = view.ndim();
41-
let nth_idx_max = view.shape().iter().last().unwrap();
41+
let nth_idx_max = view.shape()[ndim-1];
4242

4343
// None will be an empty iter.
4444
let mut last_index = match view.dim().into_dimension().first_index() {

0 commit comments

Comments
 (0)