[
https://issues.apache.org/jira/browse/GROOVY-11308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817212#comment-17817212
]
ASF GitHub Bot commented on GROOVY-11308:
-----------------------------------------
paulk-asert commented on PR #2056:
URL: https://github.com/apache/groovy/pull/2056#issuecomment-1943102336
Merged, thanks! There is a small tweak we can do to get the minor
performance gain that I think the original code was after, but I can do that
after the merge.
> DefaultGroovyMethods#unique now returns null for empty or 1 element input
> -------------------------------------------------------------------------
>
> Key: GROOVY-11308
> URL: https://issues.apache.org/jira/browse/GROOVY-11308
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 3.0.21, 4.0.19, 5.0.0-alpha-6
> Reporter: Octavia Togami
> Priority: Critical
>
> https://github.com/apache/groovy/commit/c181ef72e442f1d51855e0db6d44ab302cf7c662
> changed the behavior of {{DefaultGroovyMethods#unique}} to return {{null}}
> for an empty or one element collection input when {{mutate}} is {{false}}.
> This requires a really awkward workaround and breaks compatibility with
> previous versions, and I personally don't think the behavior makes sense.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)