Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.6
-
None
Description
The ObjectRange.size() method has optimisations for BigDecimal, Integer and Long, but not BigInteger
https://github.com/groovy/groovy-core/blob/master/src/main/groovy/lang/ObjectRange.java#L262
This means that calling:
(1G..2147483647G).size()
Takes ages
Could we change:
} else if (from instanceof BigInteger || to instanceof BigInteger) {
to
} else if (from instanceof BigDecimal || to instanceof BigDecimal || from instanceof BigInteger || to instanceof BigInteger ) {
To catch this?