From 9b179f51a62d6b35f2523a58855c04506099548a Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 28 Feb 2019 21:17:18 +0100 Subject: [PATCH] [NUSTitle] Simplify the getFSTEntriesFlatByContents function --- src/de/mas/wiiu/jnus/NUSTitle.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/de/mas/wiiu/jnus/NUSTitle.java b/src/de/mas/wiiu/jnus/NUSTitle.java index 937973f..c0de858 100644 --- a/src/de/mas/wiiu/jnus/NUSTitle.java +++ b/src/de/mas/wiiu/jnus/NUSTitle.java @@ -25,6 +25,7 @@ import java.util.Map.Entry; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import de.mas.wiiu.jnus.entities.TMD; import de.mas.wiiu.jnus.entities.Ticket; @@ -58,13 +59,7 @@ public class NUSTitle { } public List getFSTEntriesFlatByContents(List list) { - List entries = new ArrayList<>(); - for (Content c : list) { - for (FSTEntry f : c.getEntries()) { - entries.add(f); - } - } - return entries; + return list.stream().flatMap(c -> c.getEntries().stream()).collect(Collectors.toList()); } public List getAllFSTEntriesFlat() {