[
https://issues.apache.org/jira/browse/GROOVY-10696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17569783#comment-17569783
]
ASF GitHub Bot commented on GROOVY-10696:
-----------------------------------------
paulk-asert merged PR #1750:
URL: https://github.com/apache/groovy/pull/1750
> The DGM removeAll variants which take a closure can be refactored to use
> removeIf for better efficiency
> -------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-10696
> URL: https://issues.apache.org/jira/browse/GROOVY-10696
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
> We'd want all of the normal variations to work unchanged:
> {code}
> def list = ['a', 'b']
> list.removeAll { it == 'b' }
> assert list == ['a']
> def m1 = [a:1, b:2]
> m1.removeAll { k,v -> k == 'b' }
> assert m1 == [a:1]
> def m2 = [a:1, b:2]
> m2.removeAll { k,v -> v == 1 }
> assert m2 == [b:2]
> def m3 = [a:1, b:2]
> m3.removeAll { e -> e.key == 'b' }
> assert m3 == [a:1]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)