Skip to content

Commit

Permalink
refactor: Use functional style for single expression
Browse files Browse the repository at this point in the history
  • Loading branch information
sgcr committed Nov 3, 2024
1 parent ae6d3fc commit 745b124
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/core/net/DownloadFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ private void fillOldFixturesList(DefaultMutableTreeNode previousSeriesData) {
int finalI = i;
var season = seasons.stream().filter(f -> f.getSaison() == finalI).findFirst();
var itemText = new StringBuilder(TranslationFacility.tr("Season")).append(" ").append(i);
if (season.isPresent()) {
itemText.append(" / ").append(season.get().getLigaName());
}
season.ifPresent(fixture -> itemText.append(" / ").append(fixture.getLigaName()));
previousSeriesData.add(new DefaultMutableTreeNode(Pair.of(itemText.toString(), finalI)));
}
}
Expand Down

0 comments on commit 745b124

Please sign in to comment.