@@ -241,7 +241,7 @@ function iterate(itr::SkipMissing, state...)
241241 y = iterate (itr. x, state... )
242242 y === nothing && return nothing
243243 item, state = y
244- while item === missing
244+ while ismissing ( item)
245245 y = iterate (itr. x, state)
246246 y === nothing && return nothing
247247 item, state = y
@@ -251,12 +251,12 @@ end
251251
252252IndexStyle (:: Type{<:SkipMissing{T}} ) where {T} = IndexStyle (T)
253253eachindex (itr:: SkipMissing ) =
254- Iterators. filter (i -> @inbounds (itr. x[i]) != = missing , eachindex (itr. x))
254+ Iterators. filter (i -> ! ismissing ( @inbounds (itr. x[i])) , eachindex (itr. x))
255255keys (itr:: SkipMissing ) =
256- Iterators. filter (i -> @inbounds (itr. x[i]) != = missing , keys (itr. x))
256+ Iterators. filter (i -> ! ismissing ( @inbounds (itr. x[i])) , keys (itr. x))
257257@propagate_inbounds function getindex (itr:: SkipMissing , I... )
258258 v = itr. x[I... ]
259- v === missing && throw (MissingException (LazyString (" the value at index " , I, " is missing" )))
259+ ismissing (v) && throw (MissingException (LazyString (" the value at index " , I, " is missing" )))
260260 v
261261end
262262
@@ -280,18 +280,18 @@ function _mapreduce(f, op, ::IndexLinear, itr::SkipMissing{<:AbstractArray})
280280 ilast = last (inds)
281281 for outer i in i: ilast
282282 @inbounds ai = A[i]
283- ai != = missing && break
283+ ! ismissing (ai) && break
284284 end
285- ai === missing && return mapreduce_empty (f, op, eltype (itr))
285+ ismissing (ai) && return mapreduce_empty (f, op, eltype (itr))
286286 a1:: eltype (itr) = ai
287287 i == typemax (typeof (i)) && return mapreduce_first (f, op, a1)
288288 i += 1
289289 ai = missing
290290 for outer i in i: ilast
291291 @inbounds ai = A[i]
292- ai != = missing && break
292+ ! ismissing (ai) && break
293293 end
294- ai === missing && return mapreduce_first (f, op, a1)
294+ ismissing (ai) && return mapreduce_first (f, op, a1)
295295 # We know A contains at least two non-missing entries: the result cannot be nothing
296296 something (mapreduce_impl (f, op, itr, first (inds), last (inds)))
297297end
@@ -309,7 +309,7 @@ mapreduce_impl(f, op, A::SkipMissing, ifirst::Integer, ilast::Integer) =
309309 return nothing
310310 elseif ifirst == ilast
311311 @inbounds a1 = A[ifirst]
312- if a1 === missing
312+ if ismissing (a1)
313313 return nothing
314314 else
315315 return Some (mapreduce_first (f, op, a1))
@@ -320,25 +320,25 @@ mapreduce_impl(f, op, A::SkipMissing, ifirst::Integer, ilast::Integer) =
320320 i = ifirst
321321 for outer i in i: ilast
322322 @inbounds ai = A[i]
323- ai != = missing && break
323+ ! ismissing (ai) && break
324324 end
325- ai === missing && return nothing
325+ ismissing (ai) && return nothing
326326 a1 = ai:: eltype (itr)
327327 i == typemax (typeof (i)) && return Some (mapreduce_first (f, op, a1))
328328 i += 1
329329 ai = missing
330330 for outer i in i: ilast
331331 @inbounds ai = A[i]
332- ai != = missing && break
332+ ! ismissing (ai) && break
333333 end
334- ai === missing && return Some (mapreduce_first (f, op, a1))
334+ ismissing (ai) && return Some (mapreduce_first (f, op, a1))
335335 a2 = ai:: eltype (itr)
336336 i == typemax (typeof (i)) && return Some (op (f (a1), f (a2)))
337337 i += 1
338338 v = op (f (a1), f (a2))
339339 @simd for i = i: ilast
340340 @inbounds ai = A[i]
341- if ai != = missing
341+ if ! ismissing (ai)
342342 v = op (v, f (ai))
343343 end
344344 end
@@ -384,7 +384,7 @@ julia> filter(isodd, skipmissing(x))
384384function filter (f, itr:: SkipMissing{<:AbstractArray} )
385385 y = similar (itr. x, eltype (itr), 0 )
386386 for xi in itr. x
387- if xi != = missing && f (xi)
387+ if ! ismissing (xi) && f (xi)
388388 push! (y, xi)
389389 end
390390 end
@@ -450,7 +450,7 @@ ERROR: `b` is still missing
450450macro coalesce (args... )
451451 expr = :(missing )
452452 for arg in reverse (args)
453- expr = :(( val = $ arg) != = missing ? val : $ expr)
453+ expr = :(! ismissing (( val = $ arg;)) ? val : $ expr)
454454 end
455455 return esc (:(let val; $ expr; end ))
456456end
0 commit comments