Skip to content

Commit

Permalink
(yegor256#1384) Remove extra wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Sep 19, 2020
1 parent a1a587c commit 7925bc6
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/main/java/org/cactoos/map/Grouped.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/**
Expand Down Expand Up @@ -58,18 +57,14 @@ public Grouped(
final Function<T, V> values
) {
super(
new MapOf<>(
() -> {
final Stream<T> stream = StreamSupport.stream(
list.spliterator(), false
);
return stream.collect(
Collectors.groupingBy(
keys,
Collectors.mapping(values, Collectors.toList())
)
);
})
StreamSupport.stream(
list.spliterator(), false
).collect(
Collectors.groupingBy(
keys,
Collectors.mapping(values, Collectors.toList())
)
)
);
}
}

0 comments on commit 7925bc6

Please sign in to comment.