Skip to content

Commit

Permalink
(#1212) Refactoring due to code review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
fanifieiev committed Nov 4, 2019
1 parent 0d75b50 commit 77b0162
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/cactoos/set/SetOf.java
Expand Up @@ -26,9 +26,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.cactoos.Proc;
import org.cactoos.iterable.IterableOf;
import org.cactoos.scalar.And;

/**
* Iterable as {@link Set}.
Expand Down Expand Up @@ -61,8 +59,7 @@ public SetOf(final T... array) {
public SetOf(final Iterable<T> src) {
super(() -> {
final Set<T> tmp = new HashSet<>();
new And((Proc<T>) tmp::add, src)
.value();
src.forEach(tmp::add);
return Collections.unmodifiableSet(tmp);
});
}
Expand Down

0 comments on commit 77b0162

Please sign in to comment.