Skip to content

Commit

Permalink
Add custom implementation of unaliascopy(::LogicalIndex)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Aug 19, 2020
1 parent d2537fa commit 1c153b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ LogicalIndex{Int}(mask::AbstractArray) = LogicalIndex{Int, typeof(mask)}(mask)
size(L::LogicalIndex) = (L.sum,)
length(L::LogicalIndex) = L.sum
collect(L::LogicalIndex) = [i for i in L]
unaliascopy(L::TL) where {TL <: LogicalIndex} = TL(unaliascopy(L.mask))
show(io::IO, r::LogicalIndex) = print(io,collect(r))
print_array(io::IO, X::LogicalIndex) = print_array(io, collect(X))
# Iteration over LogicalIndex is very performance-critical, but it also must
Expand Down

0 comments on commit 1c153b2

Please sign in to comment.