Skip to content

Commit 8099de8

Browse files
jmh5309il
authored andcommitted
Adjusting zip index
Fixing a bug in the way zip checks for lengths and strides.
1 parent b744214 commit 8099de8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/mir/ndslice/topology.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,9 +2479,9 @@ auto zip
24792479
foreach(i, S; Slices[1 .. $])
24802480
{
24812481
static assert(isSlice!S == packs, "zip: all Slices must have the same shape packs");
2482-
assert(slices[i]._lengths == slices[0]._lengths, "zip: all slices must have the same lengths");
2482+
assert(slices[i + 1]._lengths == slices[0]._lengths, "zip: all slices must have the same lengths");
24832483
static if (sameStrides)
2484-
assert(slices[i].unpack.strides == slices[0].unpack.strides, "zip: all slices must have the same strides");
2484+
assert(slices[i + 1].unpack.strides == slices[0].unpack.strides, "zip: all slices must have the same strides");
24852485
}
24862486
static if (!sameStrides && minElem(staticMap!(kindOf, Slices)) != Contiguous)
24872487
{

0 commit comments

Comments
 (0)