Github user tkruse commented on a diff in the pull request: https://github.com/apache/groovy/pull/360#discussion_r69213358 --- Diff: src/main/groovy/lang/ObjectRange.java --- @@ -240,16 +237,16 @@ public Object get(int index) { if (index < 0) { throw new IndexOutOfBoundsException("Index: " + index + " should not be negative"); } - final StepIterator iter = new StepIterator(this, 1); - Object value = iter.next(); - for (int i = 0; i < index; i++) { - if (!iter.hasNext()) { + int i = 0; + for (Iterator it = iterator(); ; i++) { --- End diff -- because of synchronization, iterator() returns a slower implementation. So should be better to keep raw StepIterator
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---