Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
putianyi889 committed Nov 15, 2023
1 parent 9725759 commit 7bacf0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,8 @@ end

# In particular, these make iszero(Eye(n)) efficient.
# use any/all on scalar to get Boolean error message
any(f::Function, x::AbstractFill) = !isempty(x) && any(f(getindex_value(x)))
all(f::Function, x::AbstractFill) = isempty(x) || all(f(getindex_value(x)))
any(x::AbstractFill) = any(identity, x)
all(x::AbstractFill) = all(identity, x)
Base._any(f::Function, x::AbstractFill, ::Colon) = !isempty(x) && any(f(getindex_value(x)))
Base._all(f::Function, x::AbstractFill, ::Colon) = isempty(x) || all(f(getindex_value(x)))

count(x::AbstractOnes{Bool}) = length(x)
count(x::AbstractZeros{Bool}) = 0
Expand Down
1 change: 0 additions & 1 deletion src/fillbroadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ for (op, iterop) in ((:+, :*), (:*, :^), (:add_sum, :mul_prod), (:mul_prod, :^),
end
end


function mapreduce(f, op, A::AbstractFill, B::AbstractFill; kw...)
val(_...) = f(getindex_value(A), getindex_value(B))
reduce(op, map(val, A, B); kw...)
Expand Down

0 comments on commit 7bacf0d

Please sign in to comment.