From c29240d4299b8c99ca4b13d7d0d8cbb9dc4ea8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 28 Feb 2020 00:35:16 +0000 Subject: [PATCH] Use `begin` in place of `firstindex` --- base/abstractarray.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 0931e94aa47be7..3d107afdbe6906 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -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) @@ -401,7 +401,7 @@ julia> first(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)