Skip to content

Commit 2263749

Browse files
authored
avoid defining one arg hash (#631)
these are not really meant to be extended
1 parent 6a4980a commit 2263749

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

src/dual.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ Base.exponent(x::Dual) = exponent(value(x))
336336

337337
Base.div(x::Dual, y::Dual, r::RoundingMode) = div(value(x), value(y), r)
338338

339-
Base.hash(d::Dual) = hash(value(d))
340339
Base.hash(d::Dual, hsh::UInt) = hash(value(d), hsh)
341340

342341
function Base.read(io::IO, ::Type{Dual{T,V,N}}) where {T,V,N}

src/partials.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Base.:(==)(a::Partials{N}, b::Partials{N}) where {N} = a.values == b.values
5252

5353
const PARTIALS_HASH = hash(Partials)
5454

55-
Base.hash(partials::Partials) = hash(partials.values, PARTIALS_HASH)
56-
Base.hash(partials::Partials, hsh::UInt64) = hash(hash(partials), hsh)
55+
Base.hash(partials::Partials, hsh::UInt64) = hash(hash(partials.values, PARTIALS_HASH), hsh)
5756

5857
@inline Base.copy(partials::Partials) = partials
5958

test/PartialsTest.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ samerng() = MersenneTwister(1)
6262
@test isequal(PARTIALS, copy(PARTIALS))
6363
@test isequal(PARTIALS, PARTIALS2) == (N == 0)
6464

65-
@test hash(PARTIALS) == hash(VALUES, ForwardDiff.PARTIALS_HASH)
6665
@test hash(PARTIALS) == hash(copy(PARTIALS))
6766
@test hash(PARTIALS, hash(1)) == hash(copy(PARTIALS), hash(1))
6867
@test hash(PARTIALS, hash(1)) == hash(copy(PARTIALS), hash(1))

0 commit comments

Comments
 (0)