Fix the getFSTEntriesByContentIndex function

This commit is contained in:
Maschell 2019-05-04 11:11:04 +02:00
parent 010e349af9
commit 156fcd02df

View File

@ -130,10 +130,12 @@ public class FSTUtils {
public static Stream<FSTEntry> getFSTEntriesByContentIndexAsStream(FSTEntry entry, short index) {
return entry.getChildren().stream()//
.filter(e -> e.getContentIndex() == index) //
.flatMap(e -> {
if (!e.isDir()) {
return Stream.of(e);
if (e.getContentIndex() == index) {
return Stream.of(e);
}
return Stream.empty();
}
return getFSTEntriesByContentIndexAsStream(e, index);
});