Skip to content

Commit 222f7f2

Browse files
authored
Propagate inbounds in diagzero (#1285)
1 parent e65e75c commit 222f7f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diagonal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ end
191191
Return the appropriate zero element `A[i, j]` corresponding to a banded matrix `A`.
192192
"""
193193
diagzero(A::AbstractMatrix, i, j) = zero(eltype(A))
194-
diagzero(A::AbstractMatrix{M}, i, j) where {M<:AbstractMatrix} =
194+
@propagate_inbounds diagzero(A::AbstractMatrix{M}, i, j) where {M<:AbstractMatrix} =
195195
zeroslike(M, axes(A[i,i], 1), axes(A[j,j], 2))
196196
diagzero(A::AbstractMatrix, inds...) = diagzero(A, to_indices(A, inds)...)
197197
# dispatching on the axes permits specializing on the axis types to return something other than an Array

0 commit comments

Comments
 (0)