aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt b/src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt
index e6dad79..713242c 100644
--- a/src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt
+++ b/src/main/kotlin/moe/nea/firmament/util/IdentityCharacteristics.kt
@@ -1,5 +1,6 @@
/*
* SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
@@ -8,7 +9,9 @@ package moe.nea.firmament.util
class IdentityCharacteristics<T>(val value: T) {
override fun equals(other: Any?): Boolean {
- return value === other
+ if (this === other) return true
+ if (other !is IdentityCharacteristics<*>) return false
+ return value === other.value
}
override fun hashCode(): Int {