diff --git a/src/array.jl b/src/array.jl index 834658e4..ab538499 100644 --- a/src/array.jl +++ b/src/array.jl @@ -304,7 +304,7 @@ convert(::Type{CategoricalArray{T, N}}, A::CategoricalArray{T, N}) where {T, N} convert(::Type{CategoricalArray{T}}, A::CategoricalArray{T}) where {T} = A convert(::Type{CategoricalArray}, A::CategoricalArray) = A -function @compat(Base.:(==))(A::CategoricalArray, B::CategoricalArray) +function Base.:(==)(A::CategoricalArray, B::CategoricalArray) if size(A) != size(B) return false end diff --git a/src/pool.jl b/src/pool.jl index 8e6d4797..17ad2719 100644 --- a/src/pool.jl +++ b/src/pool.jl @@ -6,12 +6,12 @@ function CategoricalPool(index::Vector{S}, CategoricalPool{S, R, CategoricalValue{S, R}}(index, invindex, order, ordered) end -@compat (::Type{CategoricalPool{T, R}})(ordered::Bool=false) where {T, R} = +(::Type{CategoricalPool{T, R}})(ordered::Bool=false) where {T, R} = CategoricalPool(T[], Dict{T, R}(), R[], ordered) -@compat (::Type{CategoricalPool{T}})(ordered::Bool=false) where {T} = +(::Type{CategoricalPool{T}})(ordered::Bool=false) where {T} = CategoricalPool(T[], Dict{T, DefaultRefType}(), DefaultRefType[], ordered) -@compat function (::Type{CategoricalPool{T, R}})(index::Vector, +function (::Type{CategoricalPool{T, R}})(index::Vector, ordered::Bool=false) where {T, R} invindex = buildinvindex(index, R) order = Vector{R}(1:length(index)) diff --git a/src/typedefs.jl b/src/typedefs.jl index 589a8c5b..89b235fb 100644 --- a/src/typedefs.jl +++ b/src/typedefs.jl @@ -1,6 +1,6 @@ using Nulls -@compat const DefaultRefType = UInt32 +const DefaultRefType = UInt32 ## Pools diff --git a/src/value.jl b/src/value.jl index 2ca7a865..c743b2ec 100644 --- a/src/value.jl +++ b/src/value.jl @@ -28,7 +28,7 @@ Base.convert(::Type{S}, x::CategoricalValue) where {S} = convert(S, index(x.pool Base.convert(::Type{Union{S, Null}}, x::CategoricalValue) where {S} = convert(S, index(x.pool)[x.level]) function Base.show(io::IO, x::CategoricalValue{T}) where {T} - if @compat(get(io, :compact, false)) + if get(io, :compact, false) print(io, repr(index(x.pool)[x.level])) elseif isordered(x.pool) @printf(io, "%s %s (%i/%i)", @@ -51,11 +51,11 @@ end end # To fix ambiguities with Base -@compat Base.:(==)(x::CategoricalValue, y::WeakRef) = index(x.pool)[x.level] == y -@compat Base.:(==)(x::WeakRef, y::CategoricalValue) = y == x +Base.:(==)(x::CategoricalValue, y::WeakRef) = index(x.pool)[x.level] == y +Base.:(==)(x::WeakRef, y::CategoricalValue) = y == x -@compat Base.:(==)(x::CategoricalValue, y::Any) = index(x.pool)[x.level] == y -@compat Base.:(==)(x::Any, y::CategoricalValue) = y == x +Base.:(==)(x::CategoricalValue, y::Any) = index(x.pool)[x.level] == y +Base.:(==)(x::Any, y::CategoricalValue) = y == x @inline function Base.isequal(x::CategoricalValue, y::CategoricalValue) if x.pool === y.pool