Skip to content

Commit 560604b

Browse files
committed
FIX: Remove redundant bound check in fold_axis
This is already checked by axis_iter. The test could have told me that, if I'd only have run it before the fix. The new doc that it does panic should stay.
1 parent 3ce3059 commit 560604b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/impl_methods.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,10 +1834,6 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
18341834
F: FnMut(&B, &A) -> B,
18351835
B: Clone,
18361836
{
1837-
if axis.index() >= self.ndim() {
1838-
panic!("ndarray: axis {} out of bounds in array of dim {} in fold_axis",
1839-
axis.index(), self.ndim());
1840-
}
18411837
let mut res = Array::from_elem(self.raw_dim().remove_axis(axis), init);
18421838
for subview in self.axis_iter(axis) {
18431839
res.zip_mut_with(&subview, |x, y| *x = fold(x, y));

0 commit comments

Comments
 (0)