Inline single use local variable

This commit is contained in:
Gary Gregory 2024-08-31 17:34:29 -04:00
parent deadbda8b7
commit fa76c00a4f
1 changed files with 1 additions and 3 deletions

View File

@ -276,8 +276,6 @@ public class SetUtils {
Objects.requireNonNull(setA, "setA");
Objects.requireNonNull(setB, "setB");
final Predicate<E> containedInB = setB::contains;
return new SetView<E>() {
@Override
public boolean contains(final Object o) {
@ -286,7 +284,7 @@ public class SetUtils {
@Override
public Iterator<E> createIterator() {
return IteratorUtils.filteredIterator(setA.iterator(), containedInB);
return IteratorUtils.filteredIterator(setA.iterator(), setB::contains);
}
};
}