diff --git a/ts-core/src/main/kotlin/cn/tursom/core/context/ContextKey.kt b/ts-core/src/main/kotlin/cn/tursom/core/context/ContextKey.kt index 25833e5..6731486 100644 --- a/ts-core/src/main/kotlin/cn/tursom/core/context/ContextKey.kt +++ b/ts-core/src/main/kotlin/cn/tursom/core/context/ContextKey.kt @@ -3,4 +3,18 @@ package cn.tursom.core.context data class ContextKey( val envId: Int, val id: Int, -) +) { + override fun hashCode(): Int { + return id + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is ContextKey<*>) return false + + if (envId != other.envId) return false + if (id != other.id) return false + + return true + } +}