Skip to content

Commit

Permalink
Use Java streams in AbstractInfoPlayQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Feb 19, 2022
1 parent 5f1f52b commit 4789cf6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.schabi.newpipe.extractor.Page;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import io.reactivex.rxjava3.core.SingleObserver;
import io.reactivex.rxjava3.disposables.Disposable;
Expand Down Expand Up @@ -132,10 +132,6 @@ public void dispose() {
}

private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
final List<PlayQueueItem> result = new ArrayList<>();
for (final StreamInfoItem stream : infoItems) {
result.add(new PlayQueueItem(stream));
}
return result;
return infoItems.stream().map(PlayQueueItem::new).collect(Collectors.toList());
}
}

0 comments on commit 4789cf6

Please sign in to comment.