Specialize contentDeepEquals/HashCode/ToString for arrays of unsigned types
#KT-26388
This commit is contained in:
+3
@@ -993,6 +993,9 @@ public final class kotlin/collections/ArraysKt {
|
||||
public static final fun contains ([Ljava/lang/Object;Ljava/lang/Object;)Z
|
||||
public static final fun contains ([SS)Z
|
||||
public static final fun contains ([ZZ)Z
|
||||
public static final fun contentDeepEquals ([Ljava/lang/Object;[Ljava/lang/Object;)Z
|
||||
public static final fun contentDeepHashCode ([Ljava/lang/Object;)I
|
||||
public static final fun contentDeepToString ([Ljava/lang/Object;)Ljava/lang/String;
|
||||
public static final fun copyInto ([B[BIII)[B
|
||||
public static final fun copyInto ([C[CIII)[C
|
||||
public static final fun copyInto ([D[DIII)[D
|
||||
|
||||
@@ -105,7 +105,15 @@ object ArrayOps : TemplateGroupBase() {
|
||||
returns("Boolean")
|
||||
on(Platform.JVM) {
|
||||
inlineOnly()
|
||||
body { "return java.util.Arrays.deepEquals(this, other)" }
|
||||
annotation("""@JvmName("contentDeepEqualsInline")""")
|
||||
body {
|
||||
"""
|
||||
if (kotlin.internal.apiVersionIsAtLeast(1, 3, 0))
|
||||
return contentDeepEqualsImpl(other)
|
||||
else
|
||||
return java.util.Arrays.deepEquals(this, other)
|
||||
"""
|
||||
}
|
||||
}
|
||||
on(Platform.JS) {
|
||||
annotation("""@library("arrayDeepEquals")""")
|
||||
@@ -155,7 +163,15 @@ object ArrayOps : TemplateGroupBase() {
|
||||
returns("String")
|
||||
on(Platform.JVM) {
|
||||
inlineOnly()
|
||||
body { "return java.util.Arrays.deepToString(this)" }
|
||||
annotation("""@JvmName("contentDeepToStringInline")""")
|
||||
body {
|
||||
"""
|
||||
if (kotlin.internal.apiVersionIsAtLeast(1, 3, 0))
|
||||
return contentDeepToStringImpl()
|
||||
else
|
||||
return java.util.Arrays.deepToString(this)
|
||||
"""
|
||||
}
|
||||
}
|
||||
on(Platform.JS) {
|
||||
annotation("""@library("arrayDeepToString")""")
|
||||
@@ -200,7 +216,15 @@ object ArrayOps : TemplateGroupBase() {
|
||||
returns("Int")
|
||||
on(Platform.JVM) {
|
||||
inlineOnly()
|
||||
body { "return java.util.Arrays.deepHashCode(this)" }
|
||||
annotation("""@JvmName("contentDeepHashCodeInline")""")
|
||||
body {
|
||||
"""
|
||||
if (kotlin.internal.apiVersionIsAtLeast(1, 3, 0))
|
||||
return contentDeepHashCodeImpl()
|
||||
else
|
||||
return java.util.Arrays.deepHashCode(this)
|
||||
"""
|
||||
}
|
||||
}
|
||||
on(Platform.JS) {
|
||||
annotation("""@library("arrayDeepHashCode")""")
|
||||
|
||||
Reference in New Issue
Block a user