Skip to content

Commit

Permalink
start->first in getindex
Browse files Browse the repository at this point in the history
This happened to work because start returns the same thing as first for our two OrdinalRange types in base, but it's not guaranteed for all possible OrdinalRange types.
  • Loading branch information
timholy committed Feb 20, 2017
1 parent 0bd8e2b commit faa9b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/twiceprecision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function getindex{T}(r::StepRangeLen{T,<:TwicePrecision,<:TwicePrecision}, s::Or
@boundscheck checkbounds(r, s)
soffset = 1 + round(Int, (r.offset - first(s))/step(s))
soffset = clamp(soffset, 1, length(s))
ioffset = start(s) + (soffset-1)*step(s)
ioffset = first(s) + (soffset-1)*step(s)
if step(s) == 1 || length(s) < 2
newstep = r.step
else
Expand Down

0 comments on commit faa9b15

Please sign in to comment.