Skip to content

Commit 46a44e1

Browse files
authored
Propagate inbounds correctly in getindex (#220)
* propagate inbounds in getindex * vector bool indexing
1 parent 4ad663d commit 46a44e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/FillArrays.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ const AbstractFillVecOrMat{T} = Union{AbstractFillVector{T},AbstractFillMatrix{T
3434

3535
==(a::AbstractFill, b::AbstractFill) = axes(a) == axes(b) && getindex_value(a) == getindex_value(b)
3636

37-
Base.@propagate_inbounds @inline function _fill_getindex(F::AbstractFill, kj::Integer...)
37+
@inline function _fill_getindex(F::AbstractFill, kj::Integer...)
3838
@boundscheck checkbounds(F, kj...)
3939
getindex_value(F)
4040
end
4141

42-
getindex(F::AbstractFill, k::Integer) = _fill_getindex(F, k)
43-
getindex(F::AbstractFill{T, N}, kj::Vararg{Integer, N}) where {T, N} = _fill_getindex(F, kj...)
42+
Base.@propagate_inbounds getindex(F::AbstractFill, k::Integer) = _fill_getindex(F, k)
43+
Base.@propagate_inbounds getindex(F::AbstractFill{T, N}, kj::Vararg{Integer, N}) where {T, N} = _fill_getindex(F, kj...)
4444

4545
@inline function setindex!(F::AbstractFill, v, k::Integer)
4646
@boundscheck checkbounds(F, k)
@@ -195,8 +195,8 @@ Base.@propagate_inbounds @inline Base._unsafe_getindex(::IndexStyle, F::Abstract
195195

196196

197197

198-
getindex(A::AbstractFill, kr::AbstractVector{Bool}) = _fill_getindex(A, kr)
199-
getindex(A::AbstractFill, kr::AbstractArray{Bool}) = _fill_getindex(A, kr)
198+
Base.@propagate_inbounds getindex(A::AbstractFill, kr::AbstractVector{Bool}) = _fill_getindex(A, kr)
199+
Base.@propagate_inbounds getindex(A::AbstractFill, kr::AbstractArray{Bool}) = _fill_getindex(A, kr)
200200

201201
@inline Base.iterate(F::AbstractFill) = length(F) == 0 ? nothing : (v = getindex_value(F); (v, (v, 1)))
202202
@inline function Base.iterate(F::AbstractFill, (v, n))

0 commit comments

Comments
 (0)