From 5b29efa59bd8ee067746173ced7321d5be804fb5 Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Sat, 9 Dec 2017 14:27:39 -0500 Subject: [PATCH] use stevengj's suggested `hash(Char)` definition --- base/char.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/char.jl b/base/char.jl index 600c3f6272d556..193087efd05f54 100644 --- a/base/char.jl +++ b/base/char.jl @@ -81,7 +81,8 @@ in(x::Char, y::Char) = x == y ==(x::Char, y::Char) = reinterpret(UInt32, x) == reinterpret(UInt32, y) isless(x::Char, y::Char) = reinterpret(UInt32, x) < reinterpret(UInt32, y) -hash(x::Char, h::UInt) = hash(reinterpret(UInt32, x), hash(Char, h)) +hash(x::Char, h::UInt) = + hash_uint64(((reinterpret(UInt32, x) + UInt64(hashchar_seed)) << 32) ⊻ UInt64(h)) -(x::Char, y::Char) = Int(x) - Int(y) -(x::Char, y::Integer) = Char(Int32(x) - Int32(y))