8000 collections.5 : Return reference to mutated param · java-to-kotlin/code@a705882 · GitHub
[go: up one dir, main page]

Skip to content

Commit a705882

Browse files
Duncan McGregordmcg
authored andcommitted
collections.5 : Return reference to mutated param
1 parent bb41254 commit a705882

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/travelator/Suffering.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.List;
44

55
import static java.util.Comparator.comparing;
6-
import static travelator.Other.SOME_COMPLICATED_RESULT;
76
import static travelator.Collections.sorted;
7+
import static travelator.Other.SOME_COMPLICATED_RESULT;
88
import static travelator.Other.routesFor;
99
import static travelator.Routes.getDepartsFrom;
1010

@@ -29,12 +29,15 @@ static List<Journey> longestJourneysIn(
2929

3030
public static List<List<Journey>> routesToShowFor(String itineraryId) {
3131
var routes = routesFor(itineraryId);
32-
removeUnbearableRoutes(routes);
32+
routes = removeUnbearableRoutes(routes);
3333
return routes;
3434
}
3535

36-
private static void removeUnbearableRoutes(List<List<Journey>> routes) {
36+
private static List<List<Journey>> removeUnbearableRoutes
37+
(List<List<Journey>> routes
38+
) {
3739
routes.removeIf(route -> sufferScoreFor(route) > 10);
40+
return routes;
3841
}
3942

4043
private static int sufferScore(

0 commit comments

Comments
 (0)
0