Skip to content

Commit d600f8d

Browse files
Minor refactoring in Stream.java
1 parent 6b6ae8b commit d600f8d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

  • extractor/src/main/java/org/schabi/newpipe/extractor/stream

extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public Stream(final String id,
6868
* @param streamList the list of {@link Stream}s which will be compared
6969
* @return whether the list already contains one stream with equals stats
7070
*/
71-
public static boolean containSimilarStream(final Stream stream,
71+
public static boolean containSimilarStream(@Nonnull final Stream stream,
7272
final List<? extends Stream> streamList) {
7373
if (isNullOrEmpty(streamList)) {
7474
return false;
@@ -98,11 +98,9 @@ public static boolean containSimilarStream(final Stream stream,
9898
* @return whether the stream have the same stats or not, based on the criteria above
9999
*/
100100
public boolean equalStats(@Nullable final Stream other) {
101-
if (other == null || mediaFormat == null || other.mediaFormat == null) {
102-
return false;
103-
}
104-
return mediaFormat.id == other.mediaFormat.id && deliveryMethod == other.deliveryMethod
105-
&& isUrl == other.isUrl;
101+
return other != null && mediaFormat != null && other.mediaFormat != null
102+
&& mediaFormat.id == other.mediaFormat.id && deliveryMethod == other.deliveryMethod
103+
&& isUrl == other.isUrl;
106104
}
107105

108106
/**
@@ -137,6 +135,7 @@ public String getUrl() {
137135
*
138136
* @return the content or URL
139137
*/
138+
@Nonnull
140139
public String getContent() {
141140
return content;
142141
}

0 commit comments

Comments
 (0)