[ 
https://issues.apache.org/jira/browse/GROOVY-7629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King resolved GROOVY-7629.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 2.5.0-beta-1

PR partially merged as per comments in the PR. Thanks!

> ObjectRange methods duplicate functionality and should not rely on size()
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-7629
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7629
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>            Reporter: Thibault Kruse
>            Assignee: Paul King
>            Priority: Minor
>             Fix For: 2.5.0-beta-1
>
>
> The methods iterator(), step(), get(), size() and subList() all step through 
> the range, all having their own stepping implementation, which makes the 
> class more complex than it needs to be.
> Also, get(), subList() and iterator() rely on method size(), which in 
> non-numeric cases does a brute-force iteration over all elements. This causes 
> an unnecessary performance overhead in several cases (even if the value of 
> size() is cached after first computation). The overhead may be arbitrarily 
> large, and in cases the size() exceed MAX_INTEGER, the reliance leads to 
> errors.
> (Also see GROOVY-2972, GROOVY-5426).
> I suggest unifying the stepping semantics and not relying on size(). PR will 
> follow.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to