Skip to content

Commit e543145

Browse files
check zero len dims rather than is_empty
1 parent d2d9946 commit e543145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/impl_methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,8 +3221,8 @@ impl<A, D: Dimension> ArrayRef<A, D>
32213221
A: Clone + Ord + num_traits::Zero,
32223222
D: Dimension,
32233223
{
3224-
// check if array is empty
3225-
if self.is_empty() {
3224+
// Must check for zero-length dimensions
3225+
if self.shape().iter().any(|s| *s == 0) {
32263226
panic!("cannot partition an empty array");
32273227
}
32283228

0 commit comments

Comments
 (0)