Skip to content

Commit 419f541

Browse files
GnimucJeffBezanson
authored andcommitted
Base.indices1 has been renamed to Base.axes1 (#32856)
1 parent 2e971e8 commit 419f541

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/src/devdocs/offset-arrays.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ axes(A::AbstractArray{T,N}, d) where {T,N} = d <= N ? axes(A)[d] : OneTo(1)
150150
```
151151

152152
may not be what you want: you may need to specialize it to return something other than `OneTo(1)`
153-
when `d > ndims(A)`. Likewise, in `Base` there is a dedicated function `indices1` which is equivalent
153+
when `d > ndims(A)`. Likewise, in `Base` there is a dedicated function `axes1` which is equivalent
154154
to `axes(A, 1)` but which avoids checking (at runtime) whether `ndims(A) > 0`. (This is purely
155155
a performance optimization.) It is defined as:
156156

157157
```julia
158-
indices1(A::AbstractArray{T,0}) where {T} = OneTo(1)
159-
indices1(A::AbstractArray) = axes(A)[1]
158+
axes1(A::AbstractArray{T,0}) where {T} = OneTo(1)
159+
axes1(A::AbstractArray) = axes(A)[1]
160160
```
161161

162162
If the first of these (the zero-dimensional case) is problematic for your custom array type, be

0 commit comments

Comments
 (0)