We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_good_array
1 parent 9177e69 commit 339a0baCopy full SHA for 339a0ba
src/Utils.jl
@@ -77,8 +77,9 @@ end
77
# Thanks @mikmore https://discourse.julialang.org/t/fastest-way-to-check-for-inf-or-nan-in-an-array/76954/33?u=milescranmer
78
is_bad_array(x) = !is_good_array(x)
79
function is_good_array(x)
80
- IS_WINDOWS && return sum(xi -> xi * zero(xi), x) == zero(eltype(x))
81
- return isempty(x) || vmapreduce(xi -> xi * zero(xi), +, x) == zero(eltype(x))
+ isempty(x) && return true
+ IS_WINDOWS && return sum(xi -> xi * zero(xi), x) == 0
82
+ return vmapreduce(xi -> xi * zero(xi), +, x) == 0
83
end
84
const IS_WINDOWS = Sys.iswindows()
85
0 commit comments