Skip to content

Commit

Permalink
fix equals
Browse files Browse the repository at this point in the history
  • Loading branch information
cromwellian committed Sep 18, 2020
1 parent 0b9d164 commit 956ff95
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions java/arcs/core/host/ArcState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ inline class SerializedParticleState(val serializedState: String) {
* needed state the next time the [Arc] is restarted.
*/
data class ParticleState private constructor(val state: State, val cause: Exception? = null) {

override fun equals(other: Any?): Boolean = when (other) {
is ParticleState -> this.state === other.state
else -> false
}

override fun hashCode(): Int {
return state.hashCode()
}

/**
* Indicates whether a particle in this state has ever been created before (i.e. startup
* succeeded at least once).
Expand Down

0 comments on commit 956ff95

Please sign in to comment.