Skip to content

Commit 412eb3b

Browse files
authored
Remove useless in() methods (JuliaData#128)
These are not actually needed for standard collections, which rely on isequal() or == and hash(). They create ambiguities and can even be incorrect, e.g. for ObjectIdDict. They could even be less efficient than the default if we stored hashes and implemented optimized hash(::CatValue, ::UInt) methods. For reference, they have been introduced in 9638d31.
1 parent 4972555 commit 412eb3b

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/value.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ Base.isequal(x::Any, y::CatValue) = isequal(y, x)
115115
Base.isequal(::CatValue, ::Missing) = false
116116
Base.isequal(::Missing, ::CatValue) = false
117117

118-
Base.in(x::CatValue, y::Any) = get(x) in y
119-
Base.in(x::CatValue, y::Set) = get(x) in y
120118
Base.in(x::CatValue, y::AbstractRange{T}) where {T<:Integer} = get(x) in y
121119

122120
Base.hash(x::CatValue, h::UInt) = hash(get(x), h)

0 commit comments

Comments
 (0)