Skip to content

Commit

Permalink
Get the tuple case as well
Browse files Browse the repository at this point in the history
  • Loading branch information
staticfloat committed Oct 3, 2014
1 parent 28d6a11 commit f9e76c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ function ==(t1::Tuple, t2::Tuple)
return true
end

hash(::(), h::Uint) = h + uint(0x77cfa1eef01bca90)
const tuplehash_seed = Uint === Uint64 ? 0x77cfa1eef01bca90 : 0xf01bca90
hash(::(), h::Uint) = h + uint(tuplehash_seed)
hash(x::(Any,), h::Uint) = hash(x[1], hash((), h))
hash(x::(Any,Any), h::Uint) = hash(x[1], hash(x[2], hash((), h)))
hash(x::Tuple, h::Uint) = hash(x[1], hash(x[2], hash(tupletail(x), h)))
Expand Down

0 comments on commit f9e76c2

Please sign in to comment.