[
https://issues.apache.org/jira/browse/GROOVY-10696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10696:
---------------------------------
Component/s: groovy-jdk
> 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
> Components: groovy-jdk
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
> Fix For: 4.0.5
>
>
> 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)