Skip to content

Commit 744e3fd

Browse files
committed
fixup! simplify inner indices computation
1 parent a6e4e73 commit 744e3fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/reducedim.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737
###### Generic reduction functions #####
3838

3939
# Given two indices or ranges, merge them by dimension akin to a broadcasted `ifelse` over the dims
40-
_sliceall(x) = x[begin]:x[end] # avoid instabilities with OneTos and offset axes
40+
_sliceall(x) = first(x):last(x) # avoid instabilities with OneTos and offset axes
4141
_ifelseslice(b,x,y) = ifelse(b, _sliceall(x), _sliceall(y))
4242
mergeindices(b::NTuple{N,Bool}, x::CartesianIndices{N}, y::CartesianIndices{N}) where {N} =
4343
CartesianIndices(map(_ifelseslice, b, x.indices, y.indices))

0 commit comments

Comments
 (0)