-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.6
-
Component/s: groovy-jdk
-
Labels:None
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?