Skip to content

Commit

Permalink
Rename the internal union OneBasedRanges to _OneBasedRanges (#54079)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jishnub and fingolfin authored May 25, 2024
1 parent 8fd5aeb commit 2a5d553
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/subarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ FastContiguousSubArray{T,N,P,I<:Union{Tuple{Union{Slice, AbstractUnitRange}, Var
# parents of FastContiguousSubArrays may support fast indexing with AbstractUnitRanges,
# so we may just forward the indexing to the parent
# This may only be done for non-offset ranges, as the result would otherwise have offset axes
const OneBasedRanges = Union{OneTo{Int}, UnitRange{Int}, Slice{OneTo{Int}}, IdentityUnitRange{OneTo{Int}}}
function getindex(V::FastContiguousSubArray, i::OneBasedRanges)
const _OneBasedRanges = Union{OneTo{Int}, UnitRange{Int}, Slice{OneTo{Int}}, IdentityUnitRange{OneTo{Int}}}
function getindex(V::FastContiguousSubArray, i::_OneBasedRanges)
@inline
@boundscheck checkbounds(V, i)
@inbounds r = V.parent[_reindexlinear(V, i)]
Expand Down

0 comments on commit 2a5d553

Please sign in to comment.