Skip to content

Commit b766498

Browse files
committed
use .position() instead of find() to find indices
1 parent 594c4a5 commit b766498

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/dimension.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ fn fastest_varying_order<D: Dimension>(strides: &D) -> D
3030
for (ind, &val) in strides.slice().iter().enumerate() {
3131
let sorted_ind = sorted.slice()
3232
.iter()
33-
.enumerate()
34-
.find(|&(_, &x)| x == val)
35-
.unwrap().0; // cannot panic by construction
33+
.position(|&x| x == val)
34+
.unwrap(); // cannot panic by construction
3635
res.slice_mut()[sorted_ind] = ind;
3736
}
3837
res

0 commit comments

Comments
 (0)