Permalink
Browse files

make hasheq for java.math.BigIntegers conform with longs when in long…

… range
  • Loading branch information...
1 parent dff9600 commit 96e72517615cd2ccdb4fdbbeb6ffba5ad99dbdac @richhickey richhickey committed Jan 29, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/jvm/clojure/lang/Numbers.java
@@ -986,7 +986,8 @@ static int hasheq(Number x){
if(xc == Long.class
|| xc == Integer.class
|| xc == Short.class
- || xc == Byte.class)
+ || xc == Byte.class
+ || (xc == BigInteger.class && lte(x, Long.MAX_VALUE) && gte(x,Long.MIN_VALUE)))
{
long lpart = x.longValue();
return Murmur3.hashLong(lpart);

0 comments on commit 96e7251

Please sign in to comment.