Skip to content

Commit c29240d

Browse files
committed
Use begin in place of firstindex
1 parent f7c69c8 commit c29240d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/abstractarray.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ julia> first(Bool[], 1)
362362
0-element Array{Bool,1}
363363
```
364364
"""
365-
first(v::AbstractVector, n::Integer) = @inbounds v[firstindex(v):min(firstindex(v) + n - 1, end)]
365+
first(v::AbstractVector, n::Integer) = @inbounds v[begin:min(begin + n - 1, end)]
366366

367367
"""
368368
last(coll)
@@ -401,7 +401,7 @@ julia> first(Float64[], 1)
401401
0-element Array{Float64,1}
402402
```
403403
"""
404-
last(v::AbstractArray, n::Integer) = @inbounds v[max(firstindex(v), end - n + 1):end]
404+
last(v::AbstractArray, n::Integer) = @inbounds v[max(begin, end - n + 1):end]
405405

406406
"""
407407
strides(A)

0 commit comments

Comments
 (0)