You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/11/03 20:09:00 UTC

[jira] [Created] (GROOVY-11213) indexOf extension method for arrays

Eric Milles created GROOVY-11213:
------------------------------------

             Summary: indexOf extension method for arrays
                 Key: GROOVY-11213
                 URL: https://issues.apache.org/jira/browse/GROOVY-11213
             Project: Groovy
          Issue Type: Improvement
          Components: groovy-jdk
            Reporter: Eric Milles


For cases where {{Arrays#binarySearch}} cannot be used and for consistency with lists, consider adding {{indexOf(element)}} extension methods for array types.

Alternatives currently available:
{code:groovy}
Arrays.asList(array).indexOf(object)
array.findIndexOf(array, object.&equals)
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)