From 23f88e0f28ca5414df9d1b8ff6bc392f642271af Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 26 Nov 2024 14:12:34 +0100 Subject: [PATCH] VideoSize: use kotlin-derived equals equals() is the same as comparing each field, so we can use the Kotlin impl, same for hashCode() --- .../main/java/net/newpipe/newplayer/data/VideoSize.kt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/new-player/src/main/java/net/newpipe/newplayer/data/VideoSize.kt b/new-player/src/main/java/net/newpipe/newplayer/data/VideoSize.kt index a138c16..b80bf6a 100644 --- a/new-player/src/main/java/net/newpipe/newplayer/data/VideoSize.kt +++ b/new-player/src/main/java/net/newpipe/newplayer/data/VideoSize.kt @@ -46,17 +46,6 @@ internal data class VideoSize( override fun compareTo(other: VideoSize) = width * height - other.width * other.height - override fun equals(other: Any?) = - when (other) { - is VideoSize -> - other.width == this.width && other.height == this.height && pixelWidthHeightRatio == other.pixelWidthHeightRatio - - else -> false - } - - override fun hashCode() = - width + height * 999999 + (pixelWidthHeightRatio*10000).toInt() - fun getRatio() = (width * pixelWidthHeightRatio) / height