Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Zip::indexed for the 0-dimensional case
This commit fixes a panic for 0-dimensional, indexed `Zip` instances which results from an out-of-bounds index in a call to `IndexPtr::stride_offset` in `Zip::inner`. Basically, the "stride" for `IndexPtr` is the axis to update, but for the 0-dimensional case, there are no axes, so `IndexPtr::stride_offset` cannot be called without panicking due to the `self.index[stride]` access. The chosen solution is to add a special check to `Zip::apply_core` for the 0-dimensional case. Another possible solution would be to modify the loop of `Zip::inner` such that an offset would not be performed for an index of zero.
- Loading branch information