From 55c423b08dcf374731a5d403c5cc80b1909ca705 Mon Sep 17 00:00:00 2001 From: Neven Sajko Date: Fri, 23 Aug 2024 17:49:46 +0200 Subject: [PATCH] delete redundant `isequal` and `==` methods --- base/gmp.jl | 2 +- base/irrationals.jl | 2 +- base/mpfr.jl | 2 +- base/typedomainintegers.jl | 12 +++--------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/base/gmp.jl b/base/gmp.jl index 6e798bfe8e0f9..6cbb0f7cd3dac 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -580,7 +580,7 @@ end /(x::BigInt, y::Union{ClongMax,CulongMax}) = float(x)/y /(x::Union{ClongMax,CulongMax}, y::BigInt) = x/float(y) -for func ∈ (:+, :-, :*, :(==), :isequal) +for func ∈ (:+, :-, :*, :(==)) @eval begin function Base.$func((@nospecialize l::BigInt), (@nospecialize r::TypeDomainInteger)) TypeDomainIntegers.BaseHelpers.apply_n_t($func, l, r) diff --git a/base/irrationals.jl b/base/irrationals.jl index f163dd15fa063..cafb356bd1f5c 100644 --- a/base/irrationals.jl +++ b/base/irrationals.jl @@ -109,7 +109,7 @@ end <=(x::AbstractIrrational, y::AbstractFloat) = x < y <=(x::AbstractFloat, y::AbstractIrrational) = x < y -for func ∈ (:+, :-, :*, :(==), :isequal) +for func ∈ (:+, :-, :*, :(==)) @eval begin function Base.$func((@nospecialize l::Irrational), (@nospecialize r::TypeDomainInteger)) TypeDomainIntegers.BaseHelpers.apply_n_t($func, l, r) diff --git a/base/mpfr.jl b/base/mpfr.jl index 001a3acdd91d2..50b257cb5576d 100644 --- a/base/mpfr.jl +++ b/base/mpfr.jl @@ -967,7 +967,7 @@ cmp(x::CdoubleMax, y::BigFloat) = -cmp(y,x) <=(x::BigFloat, y::CdoubleMax) = !isnan(x) && !isnan(y) && cmp(x,y) <= 0 <=(x::CdoubleMax, y::BigFloat) = !isnan(x) && !isnan(y) && cmp(y,x) >= 0 -for func ∈ (:+, :-, :*, :(==), :isequal) +for func ∈ (:+, :-, :*, :(==)) @eval begin function Base.$func((@nospecialize l::BigFloat), (@nospecialize r::TypeDomainInteger)) TypeDomainIntegers.BaseHelpers.apply_n_t($func, l, r) diff --git a/base/typedomainintegers.jl b/base/typedomainintegers.jl index d82f08ee5a188..17698ec4ead78 100644 --- a/base/typedomainintegers.jl +++ b/base/typedomainintegers.jl @@ -339,7 +339,7 @@ baremodule TypeDomainIntegers baremodule BaseOverloads using ..Basic, ..RecursiveAlgorithms, ..LazyMinus, ..PrimitiveTypes, ..Conversion - using Base: Base, convert, RoundingMode, <, +, -, *, ==, isequal, isless, !, @nospecialize, @eval + using Base: Base, convert, RoundingMode, <, +, -, *, isless, !, @nospecialize, @eval function Base.zero(@nospecialize unused::Type{<:TypeDomainInteger}) zero() end @@ -436,12 +436,6 @@ baremodule TypeDomainIntegers function Base.isodd(@nospecialize o::TypeDomainInteger) !Base.iseven(o) end - function Base.:(==)((@nospecialize l::TypeDomainInteger), @nospecialize r::TypeDomainInteger) - l === r - end - function Base.isequal((@nospecialize l::TypeDomainInteger), @nospecialize r::TypeDomainInteger) - l === r - end function Base.:(<)((@nospecialize l::TypeDomainInteger), @nospecialize r::TypeDomainInteger) l_neg = l isa NegativeInteger if r isa NegativeInteger @@ -671,9 +665,9 @@ baremodule TypeDomainIntegers end baremodule BaseOverloadsBinaryOperations - using Base: Base, isequal, +, -, *, ==, @nospecialize, @eval + using Base: Base, +, -, *, ==, @nospecialize, @eval using ..Basic, ..LazyMinus, ..PrimitiveTypes, ..BaseHelpers - for type ∈ PrimitiveTypes.types_all, func ∈ (:+, :-, :*, :(==), :isequal) + for type ∈ PrimitiveTypes.types_all, func ∈ (:+, :-, :*, :(==)) @eval begin function Base.$func((@nospecialize l::$type), (@nospecialize r::TypeDomainInteger)) apply_n_t($func, l, r)