Skip to content

Commit

Permalink
Fix getindex(::SUnitRange)
Browse files Browse the repository at this point in the history
  • Loading branch information
c42f committed Jun 9, 2017
1 parent 0cbb281 commit c230d0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SUnitRange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
@pure SUnitRange(a::Int, b::Int) = SUnitRange{a, max(0, b - a + 1)}()

@pure @propagate_inbounds function getindex(x::SUnitRange{Start, L}, i::Int) where {Start, L}
@boundscheck if i < Start || i >= (Start + L)
@boundscheck if i < 1 || i > L
throw(BoundsError(x, i))
end
return Start + i - 1
Expand Down

0 comments on commit c230d0d

Please sign in to comment.