Skip to content

Commit e84d666

Browse files
authored
Add Support for BitVector and BitMatrix Indexing
Fixes #707.
1 parent 0d5b3aa commit e84d666

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/atoms/IndexAtom.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,11 @@ function Base.getindex(x::AbstractExpr, rows::AbstractVector{<:Real}, col::Real)
109109
return getindex(x, rows, col:col)
110110
end
111111

112-
function Base.getindex(x::AbstractExpr, I::AbstractMatrix{Bool})
112+
function Base.getindex(x::AbstractExpr, I::Union{AbstractMatrix{Bool}, <:BitMatrix})
113113
return [xi for (xi, ii) in zip(x, I) if ii]
114114
end
115115

116-
function Base.getindex(x::AbstractExpr, I::AbstractVector{Bool})
117-
return [xi for (xi, ii) in zip(x, I) if ii]
118-
end
119-
120-
function Base.getindex(x::AbstractExpr, I::BitMatrix)
121-
return [xi for (xi, ii) in zip(x, I) if ii]
122-
end
123-
124-
function Base.getindex(x::AbstractExpr, I::BitVector)
116+
function Base.getindex(x::AbstractExpr, I::Union{<:AbstractVector{Bool}, <:BitVector})
125117
return [xi for (xi, ii) in zip(x, I) if ii]
126118
end
127119

0 commit comments

Comments
 (0)