From a9b4d290a25feceb675dfa7249aeb5b6b59de1f3 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Thu, 24 Aug 2023 12:59:46 +0400 Subject: [PATCH] Version limit any/all specializations --- src/FillArrays.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/FillArrays.jl b/src/FillArrays.jl index fcdc1552..9f091e6a 100644 --- a/src/FillArrays.jl +++ b/src/FillArrays.jl @@ -633,10 +633,12 @@ 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) +if VERSION < v"1.9.2" + 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) +end count(x::Ones{Bool}) = length(x) count(x::Zeros{Bool}) = 0