Skip to content

Commit

Permalink
delete redundant isequal and == methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nsajko committed Aug 23, 2024
1 parent eaa25f9 commit 55c423b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion base/irrationals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 3 additions & 9 deletions base/typedomainintegers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 55c423b

Please sign in to comment.