Skip to content

Commit

Permalink
un-inline recode_in
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Nov 20, 2024
1 parent 1688fb2 commit b412ce4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/recode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ The default method is to test if any element in the `collection` `isequal` to
`x`. For `Set`s `in` is used as it is faster than the default method and equivalent to it.
A user defined type could override this method to define an appropriate test function.
"""
@inline recode_in(x, ::Missing) = false
@inline recode_in(::Missing, ::Missing) = true
@inline recode_in(x, collection::Set) = x in collection
@inline recode_in(x, collection) = x collection || any(x y for y in collection)
@inline recode_in(x::T, y::T) where T = x === y
recode_in(x, ::Missing) = false
recode_in(::Missing, ::Missing) = true
recode_in(x, collection::Set) = x in collection
recode_in(x, collection) = x collection || any(x y for y in collection)
recode_in(x::T, y::T) where T = x === y

optimize_pair(pair::Pair) = pair
optimize_pair(pair::Pair{<:AbstractArray}) = Set(pair.first) => pair.second
Expand Down

0 comments on commit b412ce4

Please sign in to comment.