Skip to content

Commit

Permalink
Stream/StreamTrack: use kotlin-derived equals
Browse files Browse the repository at this point in the history
  • Loading branch information
Profpatsch committed Nov 29, 2024
1 parent 311fdef commit f8dd665
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions new-player/src/main/java/net/newpipe/newplayer/data/StreamTrack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ data class VideoStreamTrack(

override fun toLongIdentifierString() = "$fileFormat ${toShortIdentifierString()}"

override fun equals(other: Any?) =
other is VideoStreamTrack
&& other.hashCode() == this.hashCode()

override fun hashCode(): Int {
var result = width
result = 31 * result + height
result = 31 * result + frameRate
result = 31 * result + fileFormat.hashCode()
return result
}

override fun compareTo(other: StreamTrack) =
if (other is VideoStreamTrack) {
val diff = width * height - other.width * other.height
Expand Down Expand Up @@ -101,17 +89,6 @@ data class AudioStreamTrack(
-1
}

override fun equals(other: Any?) =
other is AudioStreamTrack
&& other.hashCode() == this.hashCode()

override fun hashCode(): Int {
var result = bitrate
result = 31 * result + language.hashCode()
result = 31 * result + fileFormat.hashCode()
return result
}

override fun toString() = """
AudioStreamTrack {
bitrate = $bitrate
Expand Down

0 comments on commit f8dd665

Please sign in to comment.