[K/N] Make Any.equals simpler
This commit is contained in:
committed by
Space Team
parent
27d25b90b1
commit
deb13257c2
@@ -36,11 +36,6 @@ using namespace kotlin;
|
||||
|
||||
extern "C" {
|
||||
|
||||
// Any.kt
|
||||
KBoolean Kotlin_Any_equals(KConstRef thiz, KConstRef other) {
|
||||
return thiz == other;
|
||||
}
|
||||
|
||||
KInt Kotlin_Any_hashCode(KConstRef thiz) {
|
||||
// NOTE: `Any?.identityHashCode()` is used in Blackhole implementations of both kotlinx-benchmark and
|
||||
// K/N's own benchmarks. These usages rely on this being an intrinsic property of the object.
|
||||
|
||||
@@ -28,8 +28,7 @@ public open class Any {
|
||||
*
|
||||
* Read more about [equality](https://kotlinlang.org/docs/reference/equality.html) in Kotlin.
|
||||
*/
|
||||
@GCUnsafeCall("Kotlin_Any_equals")
|
||||
external public open operator fun equals(other: Any?): Boolean
|
||||
public open operator fun equals(other: Any?): Boolean = this === other
|
||||
|
||||
/**
|
||||
* Returns a hash code value for the object. The general contract of `hashCode` is:
|
||||
|
||||
Reference in New Issue
Block a user