Skip to content

Commit 96e7251

Browse files
committed
make hasheq for java.math.BigIntegers conform with longs when in long range
1 parent dff9600 commit 96e7251

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jvm/clojure/lang/Numbers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,8 @@ static int hasheq(Number x){
986986
if(xc == Long.class
987987
|| xc == Integer.class
988988
|| xc == Short.class
989-
|| xc == Byte.class)
989+
|| xc == Byte.class
990+
|| (xc == BigInteger.class && lte(x, Long.MAX_VALUE) && gte(x,Long.MIN_VALUE)))
990991
{
991992
long lpart = x.longValue();
992993
return Murmur3.hashLong(lpart);

0 commit comments

Comments
 (0)