@@ -10,7 +10,7 @@ import .Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), xor,
1010 sum, trailing_zeros, trailing_ones, count_ones, tryparse_internal,
1111 bin, oct, dec, hex, isequal, invmod, _prevpow2, _nextpow2, ndigits0zpb,
1212 widen, signed, unsafe_trunc, trunc, iszero, isone, big, flipsign, signbit,
13- sign, hastypemax, isodd, digits!
13+ sign, hastypemax, isodd, digits!, hash, hash_integer
1414
1515if Clong == Int32
1616 const ClongMax = Union{Int8, Int16, Int32}
768768
769769if Limb === UInt
770770 # this condition is true most (all?) of the time, and in this case we can define
771- # an optimized version of the above hash_integer(::Integer, ::UInt) method for BigInt
772- # used e.g. for Rational{BigInt}
771+ # an optimized version for BigInt of hash_integer (used e.g. for Rational{BigInt}),
772+ # and of hash
773+
774+ using . Base: hash_uint
775+
773776 function hash_integer (n:: BigInt , h:: UInt )
774777 GC. @preserve n begin
775778 s = n. size
@@ -799,7 +802,7 @@ if Limb === UInt
799802 limb <= typemin (Int) % UInt && return hash (- (limb % Int), h)
800803 end
801804 pow = trailing_zeros (x)
802- nd = ndigits0z (x, 2 )
805+ nd = Base . ndigits0z (x, 2 )
803806 idx = _divLimb (pow) + 1
804807 shift = _modLimb (pow) % UInt
805808 upshift = BITS_PER_LIMB - shift
0 commit comments