Skip to content

Commit fccf2cf

Browse files
committed
Remove warning on Jula v1.0
1 parent 5b02d4d commit fccf2cf

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/trues.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ const Falses = Zeros{Bool, N, Axes} where {N, Axes}
2323

2424
# y[mask] = x when mask isa Trues (cf y[:] = x)
2525
# Supported here only for arrays with standard OneTo axes.
26-
function Base.setindex!(y::AbstractArray{T,N}, x,
27-
mask::Trues{N, NTuple{N,Base.OneTo{Int}}},
28-
) where {T,N}
29-
if axes(x) isa NTuple{N,Base.OneTo{Int}} &&
30-
axes(y) isa NTuple{N,Base.OneTo{Int}}
26+
function Base.setindex!(y::AbstractArray{T,N}, x, mask::Trues{N, NTuple{N,Base.OneTo{Int}}}) where {T,N}
27+
if axes(x) isa NTuple{N,Base.OneTo{Int}} && axes(y) isa NTuple{N,Base.OneTo{Int}}
3128
@boundscheck size(y) == size(mask) || throw(BoundsError(y, mask))
3229
@boundscheck size(x) == size(mask) || throw(DimensionMismatch(
3330
"tried to assign $(length(x)) elements to $(length(y)) destinations"))
@@ -39,10 +36,8 @@ end
3936

4037
# x[mask] when mask isa Trues (cf x[trues(size(x))] or x[:])
4138
# Supported here only for arrays with standard OneTo axes.
42-
function Base.getindex(x::AbstractArray{T,N},
43-
mask::Trues{N, NTuple{N,Base.OneTo{Int}}},
44-
) where {T,N}
45-
if axes(x) isa NTuple{N,Base.OneTo{Int}} where N
39+
function Base.getindex(x::AbstractArray{T,N}, mask::Trues{N, NTuple{N,Base.OneTo{Int}}}) where {T,N}
40+
if axes(x) isa NTuple{N,Base.OneTo{Int}}
4641
@boundscheck size(x) == size(mask) || throw(BoundsError(x, mask))
4742
return vec(x)
4843
end

0 commit comments

Comments
 (0)