Skip to content

Commit

Permalink
fix count(::BitArray; dims) (#39149)
Browse files Browse the repository at this point in the history
Not sure why this worked before #37461, perhaps #9498?
  • Loading branch information
simeonschaub authored Jan 8, 2021
1 parent 438f9cb commit ca07546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ function bitcount(Bc::Vector{UInt64}; init::T=0) where {T}
return n
end

count(B::BitArray; init=0) = bitcount(B.chunks; init)
_count(::typeof(identity), B::BitArray, ::Colon, init) = bitcount(B.chunks; init)

function unsafe_bitfindnext(Bc::Vector{UInt64}, start::Int)
chunk_start = _div64(start-1)+1
Expand Down
1 change: 1 addition & 0 deletions test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ timesofar("datamove")
end

@test count(trues(2, 2), init=0x03) === 0x07
@test count(trues(2, 2, 2), dims=2) == fill(2, 2, 1, 2)
end

timesofar("find")
Expand Down

0 comments on commit ca07546

Please sign in to comment.