Skip to content

Commit

Permalink
Add a toggle for overridden data class behaviour of Dimensions
Browse files Browse the repository at this point in the history
Reviewed By: oprisnik

Differential Revision: D48114343

fbshipit-source-id: d64662658789150c570c8696ae5a3ee5f319790e
  • Loading branch information
steelrooter authored and facebook-github-bot committed Aug 9, 2023
1 parent 7bb6a74 commit 17dc5be
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion urimod/src/main/java/com/facebook/fresco/urimod/Dimensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@

package com.facebook.fresco.urimod

@Suppress("KtDataClass")
data class Dimensions(val w: Int, val h: Int) {
override fun toString() = "${w}x${h}"

override fun toString(): String = "${w}x${h}"

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
if (javaClass != other?.javaClass) {
return false
}

val otherDimensions: Dimensions = other as Dimensions

return w == otherDimensions.w && h == otherDimensions.h
}

override fun hashCode(): Int = 31 * w + h
}

0 comments on commit 17dc5be

Please sign in to comment.