Polish: Use ternary instead of if

This commit is contained in:
litetex 2025-01-27 22:32:01 +01:00
parent 625e9f96d2
commit 222d869efc
No known key found for this signature in database
GPG Key ID: 525B43E6039B3689

View File

@ -149,13 +149,12 @@ public class YoutubeSubscriptionExtractor extends SubscriptionExtractor {
.map(values -> { .map(values -> {
// Channel URL from second entry // Channel URL from second entry
final String channelUrl = values[1].replace("http://", "https://"); final String channelUrl = values[1].replace("http://", "https://");
if (!channelUrl.startsWith(BASE_CHANNEL_URL)) { return channelUrl.startsWith(BASE_CHANNEL_URL)
return null; ? new SubscriptionItem(
} else { service.getServiceId(),
// Channel title from third entry channelUrl,
final String title = values[2]; values[2]) // Channel title from third entry
return new SubscriptionItem(service.getServiceId(), channelUrl, title); : null;
}
}) })
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toUnmodifiableList()); .collect(Collectors.toUnmodifiableList());