Skip to content

Commit

Permalink
Use Base.require_one_based_indexing in RectDiagonal constructor (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Jul 11, 2023
1 parent 8d4d190 commit 3987311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ struct RectDiagonal{T,V<:AbstractVector{T},Axes<:Tuple{Vararg{AbstractUnitRange,
axes::Axes

@inline function RectDiagonal{T,V}(A::V, axes::Axes) where {T,V<:AbstractVector{T},Axes<:Tuple{Vararg{AbstractUnitRange,2}}}
@assert !Base.has_offset_axes(A)
Base.require_one_based_indexing(A)
@assert any(length(ax) == length(A) for ax in axes)
rd = new{T,V,Axes}(A, axes)
@assert !Base.has_offset_axes(rd)
Base.require_one_based_indexing(rd)
return rd
end
end
Expand Down

0 comments on commit 3987311

Please sign in to comment.