elect
02/21/2020, 10:05 AMremoveIf((E) -> Boolean)
and removeAll((E)->Boolean)
?Leon Linhart
02/21/2020, 10:35 AMremoveIf
is not part of the stdlib but of Java's collections since Java 8. I'd just use removeAll
since it's MPP compatible but if you only use Kotlin with Java >= 8, it does not really matter.elect
02/21/2020, 10:36 AMdiesieben07
02/21/2020, 10:42 AMremoveIf
is not an extension function it can do some performance optimizations (e.g. moving elements around in one go for ArrayList
), which removeAll
cannot do. In certain situations that might be desirable instead.elect
02/21/2020, 10:43 AM