Skip to content

Commit 18d02c2

Browse files
authored
Use top_set_bit to optimize hash(Real) (#49986)
1 parent 957972e commit 18d02c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/float.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ function hash(x::Real, h::UInt)
687687

688688
# handle values representable as Int64, UInt64, Float64
689689
if den == 1
690-
left = ndigits0z(num,2) + pow
690+
left = top_set_bit(num) + pow
691691
right = trailing_zeros(num) + pow
692692
if -1074 <= right
693693
if 0 <= right && left <= 64

0 commit comments

Comments
 (0)