Skip to content

Commit

Permalink
Use begin in place of firstindex
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Jul 10, 2020
1 parent c96f9b5 commit 0e0eced
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ julia> first(Bool[], 1)
0-element Array{Bool,1}
```
"""
first(v::AbstractVector, n::Integer) = @inbounds v[firstindex(v):min(firstindex(v) + n - 1, end)]
first(v::AbstractVector, n::Integer) = @inbounds v[begin:min(begin + n - 1, end)]

"""
last(coll)
Expand Down Expand Up @@ -401,7 +401,7 @@ julia> last(Float64[], 1)
0-element Array{Float64,1}
```
"""
last(v::AbstractArray, n::Integer) = @inbounds v[max(firstindex(v), end - n + 1):end]
last(v::AbstractArray, n::Integer) = @inbounds v[max(begin, end - n + 1):end]

"""
strides(A)
Expand Down

0 comments on commit 0e0eced

Please sign in to comment.