Skip to content

Commit

Permalink
Fix is_bad_array for empty arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed May 12, 2023
1 parent 02a8d26 commit 924a831
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ end

# Fastest way to check for NaN in an array.
# (due to optimizations in sum())
is_bad_array(array) = !isfinite(sum(array))
is_bad_array(array) = !(isempty(array) || isfinite(sum(array)))
isgood(x::T) where {T<:Number} = !(isnan(x) || !isfinite(x))
isgood(x) = true
isbad(x) = !isgood(x)
Expand Down

0 comments on commit 924a831

Please sign in to comment.