diff options
| author | bunnei <bunneidev@gmail.com> | 2023-06-12 14:45:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-12 14:45:18 -0700 |
| commit | 5f6814da47c11ce4bfafd0945058285d90a62efa (patch) | |
| tree | 18281d3c50bdb101775d81531f0f47fde19e8848 | |
| parent | a7d42ec05b8233f24046b076f787d7851ff6f95d (diff) | |
| parent | c62bbe270ae61bb1cda85d2e57cda0fd3294f5bc (diff) | |
Merge pull request #10728 from t895/game-hash
android: Use autogenerated hash code function for Game class
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt index 3d6782c499..35d8000c50 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt @@ -26,13 +26,18 @@ class Game( if (other !is Game) return false - return title == other.title - && description == other.description - && regions == other.regions - && path == other.path - && gameId == other.gameId - && company == other.company - && isHomebrew == other.isHomebrew + return hashCode() == other.hashCode() + } + + override fun hashCode(): Int { + var result = title.hashCode() + result = 31 * result + description.hashCode() + result = 31 * result + regions.hashCode() + result = 31 * result + path.hashCode() + result = 31 * result + gameId.hashCode() + result = 31 * result + company.hashCode() + result = 31 * result + isHomebrew.hashCode() + return result } companion object { |
