Skip to content

Commit b8f2442

Browse files
committed
Remove type piracy in isnan
1 parent 9c707d6 commit b8f2442

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/fixed_arrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const Mat = SMatrix
114114
const VecTypes{N, T} = Union{StaticVector{N, T}, NTuple{N, T}}
115115
const Vecf0{N} = Vec{N, Float32}
116116
const Pointf0{N} = Point{N, Float32}
117-
Base.isnan(p::StaticVector) = any(x-> isnan(x), p)
117+
Base.isnan(p::AbstractPoint) = any(isnan, p)
118118

119119
#Create constes like Mat4f0, Point2, Point2f0
120120
for i=1:4

src/rectangles.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,14 @@ function Base.to_indices(A::AbstractMatrix{T}, I::Tuple{Rect2D{IT}}) where {T, I
294294
end
295295

296296
function minmax(p::StaticVector, vmin, vmax)
297-
isnan(p) && return (vmin, vmax)
297+
any(isnan, p) && return (vmin, vmax)
298298
min.(p, vmin), max.(p, vmax)
299299
end
300300

301301
# Annoying special case for view(Vector{Point}, Vector{Face})
302302
function minmax(tup::Tuple, vmin, vmax)
303303
for p in tup
304-
isnan(p) && continue
304+
any(isnan, p) && continue
305305
vmin = min.(p, vmin)
306306
vmax = max.(p, vmax)
307307
end
@@ -353,7 +353,7 @@ end
353353
function update(b::Rect{N, T}, v::Vec{N, T}) where {N, T}
354354
m = min.(minimum(b), v)
355355
maxi = maximum(b)
356-
mm = if isnan(maxi)
356+
mm = if any(isnan, maxi)
357357
v-m
358358
else
359359
max.(v, maxi) - m

0 commit comments

Comments
 (0)