Skip to content

Commit

Permalink
Use top_set_bit to optimize hash(Real) (#49986)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored May 29, 2023
1 parent 957972e commit 18d02c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/float.jl
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function hash(x::Real, h::UInt)

# handle values representable as Int64, UInt64, Float64
if den == 1
left = ndigits0z(num,2) + pow
left = top_set_bit(num) + pow
right = trailing_zeros(num) + pow
if -1074 <= right
if 0 <= right && left <= 64
Expand Down

0 comments on commit 18d02c2

Please sign in to comment.