We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6e4e73 commit 744e3fdCopy full SHA for 744e3fd
base/reducedim.jl
@@ -37,7 +37,7 @@ end
37
###### Generic reduction functions #####
38
39
# 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
+_sliceall(x) = first(x):last(x) # avoid instabilities with OneTos and offset axes
41
_ifelseslice(b,x,y) = ifelse(b, _sliceall(x), _sliceall(y))
42
mergeindices(b::NTuple{N,Bool}, x::CartesianIndices{N}, y::CartesianIndices{N}) where {N} =
43
CartesianIndices(map(_ifelseslice, b, x.indices, y.indices))
0 commit comments