[
https://issues.apache.org/jira/browse/GROOVY-10921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17705730#comment-17705730
]
Eric Milles commented on GROOVY-10921:
--------------------------------------
I would suggest leaving "each" and "eachWithIndex" alone -- keep them as
consistent as possible across receiver types. "forEach" should be available
for arrays and could be a nice extension of "forEach" for iterables and
"forEachRemaining" for iterators.
Since Java 8 there has always been the option of using {{IntStream}} to get an
efficient for-each on an {{int[]}}. Or you could drop down to for loop. Not
sure we need micro optimizations for GDK methods, especially if there is a
signature or name change required.
> Optimised variants for AGM#each
> -------------------------------
>
> Key: GROOVY-10921
> URL: https://issues.apache.org/jira/browse/GROOVY-10921
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
>
> Similarly as for min/max, we can have variants for each which use IntConsumer
> and save boxing/unboxing overheads.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)