Skip to content

Commit ba6d190

Browse files
jishnubfingolfin
authored andcommitted
Rename the internal union OneBasedRanges to _OneBasedRanges (#54079)
This makes auto-completing `Base.OneTo` easier, as there's no ambiguity with this internal union. The leading underscore may also signal that the name is internal to `Base`. Co-authored-by: Max Horn <[email protected]>
1 parent b553fb0 commit ba6d190

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/subarray.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ FastContiguousSubArray{T,N,P,I<:Union{Tuple{Union{Slice, AbstractUnitRange}, Var
351351
# parents of FastContiguousSubArrays may support fast indexing with AbstractUnitRanges,
352352
# so we may just forward the indexing to the parent
353353
# This may only be done for non-offset ranges, as the result would otherwise have offset axes
354-
const OneBasedRanges = Union{OneTo{Int}, UnitRange{Int}, Slice{OneTo{Int}}, IdentityUnitRange{OneTo{Int}}}
355-
function getindex(V::FastContiguousSubArray, i::OneBasedRanges)
354+
const _OneBasedRanges = Union{OneTo{Int}, UnitRange{Int}, Slice{OneTo{Int}}, IdentityUnitRange{OneTo{Int}}}
355+
function getindex(V::FastContiguousSubArray, i::_OneBasedRanges)
356356
@inline
357357
@boundscheck checkbounds(V, i)
358358
@inbounds r = V.parent[_reindexlinear(V, i)]

0 commit comments

Comments
 (0)