Skip to content

Commit

Permalink
change subsetting for julia 1.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vlepori committed Apr 19, 2023
1 parent e2a4e82 commit 34d0809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elasticarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ end

function Base.deleteat!(A::ElasticArray{T,N}, idxs::NTuple{N,Union{Tuple{},Int,Vector{Int},UnitRange{Int}}}) where {T,N}
d = ndims(A)
prod(isempty.(first(idxs, length(idxs) - 1))) || throw(ArgumentError("Can only delete elements in the last dimension of A"))
prod(isempty.(idxs[1:end-1])) || throw(ArgumentError("Can only delete elements in the last dimension of A"))
issubset(last(idxs), axes(A, d)) || throw(BoundsError(A, (ntuple(_->:,d-1)..., last(idxs))))
keep = setdiff(axes(A, d), last(idxs))
copyto!(A, selectdim(A, d, keep))
Expand Down

0 comments on commit 34d0809

Please sign in to comment.