Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…anges.jl into dev
  • Loading branch information
jishnub committed Nov 3, 2019
2 parents 71fb1ed + 24aaaa4 commit d8500aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PiecewiseIncreasingRanges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ end
_compute_newrgs(R,r,x)
end

function Base.getindex(r::PiecewiseIncreasingRange{T,R,S}, x::AbstractRange{Int}) where {T,R,S}
@inline @propagate_inbounds function Base.getindex(r::PiecewiseIncreasingRange{T,R,S}, x::AbstractRange{Int}) where {T,R,S}
isempty(x) && return PiecewiseIncreasingRange{T,R,S}(R[], Int[], r.divisor)
(first(x) >= 1 && last(x) <= length(r)) || throw(BoundsError())

Expand All @@ -297,7 +297,7 @@ function Base.getindex(r::PiecewiseIncreasingRange{T,R,S}, x::AbstractRange{Int}
PiecewiseIncreasingRange{T,eltype(newrgs),S}(newrgs, r.divisor)
end

function Base.getindex(r::PiecewiseUnitRange{T,R}, x::AbstractUnitRange{Int}) where {T,R}
@inline @propagate_inbounds function Base.getindex(r::PiecewiseUnitRange{T,R}, x::AbstractUnitRange{Int}) where {T,R}
isempty(x) && return PiecewiseUnitRange{T,R}(R[], Int[])
(first(x) >= 1 && last(x) <= length(r)) || throw(BoundsError())

Expand Down

0 comments on commit d8500aa

Please sign in to comment.