Closed techsy730 closed 3 years ago
So in the JDK-primitive case there would always be a delegation in case we use a lambda. Wouldn't be more appealing to have removeIf(KEY_PREDICATE) contain the actual implementation and removeIf(JDK_PRIMITIVE_PREDICATE) to use a test / casting as in the non-JDK-primitive case? Why the different treatment?
The
removeIf
method had an ambiguity if you tried to use it with lambdas, requiring you to cast to a functor type yourself.This change fixes it so it chooses a proper primitive Predicate.
It basically applies what was done to
forEach
andforEachRemaining
toremoveIf
.