Remove duplicates of Byte and Short bitwise operations in stdlib and fix arrayOfNulls incorrectly moved to a collections package

This commit is contained in:
Pavel Punegov
2018-06-28 12:10:25 +03:00
committed by Pavel Punegov
parent e2b051e2d5
commit 391ba4b93d
4 changed files with 7 additions and 44 deletions
-10
View File
@@ -110,11 +110,6 @@ ALWAYS_INLINE KByte Kotlin_Byte_dec (KByte a ) { return
ALWAYS_INLINE KInt Kotlin_Byte_unaryPlus (KByte a ) { return +a; }
ALWAYS_INLINE KInt Kotlin_Byte_unaryMinus (KByte a ) { return -a; }
ALWAYS_INLINE KByte Kotlin_Byte_or_Byte (KByte a, KByte b) { return a | b; }
ALWAYS_INLINE KByte Kotlin_Byte_xor_Byte (KByte a, KByte b) { return a ^ b; }
ALWAYS_INLINE KByte Kotlin_Byte_and_Byte (KByte a, KByte b) { return a & b; }
ALWAYS_INLINE KByte Kotlin_Byte_inv (KByte a ) { return ~a; }
ALWAYS_INLINE KByte Kotlin_Byte_toByte (KByte a ) { return a; }
ALWAYS_INLINE KChar Kotlin_Byte_toChar (KByte a ) { return a; }
ALWAYS_INLINE KShort Kotlin_Byte_toShort (KByte a ) { return a; }
@@ -172,11 +167,6 @@ ALWAYS_INLINE KShort Kotlin_Short_dec (KShort a ) { retu
ALWAYS_INLINE KInt Kotlin_Short_unaryPlus (KShort a ) { return +a; }
ALWAYS_INLINE KInt Kotlin_Short_unaryMinus (KShort a ) { return -a; }
ALWAYS_INLINE KShort Kotlin_Short_or_Short (KShort a, KShort b) { return a | b; }
ALWAYS_INLINE KShort Kotlin_Short_xor_Short (KShort a, KShort b) { return a ^ b; }
ALWAYS_INLINE KShort Kotlin_Short_and_Short (KShort a, KShort b) { return a & b; }
ALWAYS_INLINE KShort Kotlin_Short_inv (KShort a ) { return ~a; }
ALWAYS_INLINE KByte Kotlin_Short_toByte (KShort a ) { return a; }
ALWAYS_INLINE KChar Kotlin_Short_toChar (KShort a ) { return a; }
ALWAYS_INLINE KShort Kotlin_Short_toShort (KShort a ) { return a; }
+7
View File
@@ -429,6 +429,13 @@ private class BooleanIteratorImpl(val collection: BooleanArray) : BooleanIterato
}
}
/**
* Returns an array of objects of the given type with the given [size], initialized with null values.
*/
public inline fun <reified @PureReifiable T> arrayOfNulls(size: Int): Array<T?> =
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
arrayOfUninitializedElements<T?>(size)
/**
* Returns an array containing the specified elements.
*/
@@ -186,19 +186,6 @@ public final class Byte : Number(), Comparable<Byte> {
@SymbolName("Kotlin_Byte_unaryMinus")
external public operator fun unaryMinus(): Int
/** Performs a bitwise AND operation between the two values. */
@SymbolName("Kotlin_Byte_and_Byte")
external public infix fun and(other: Byte): Byte
/** Performs a bitwise OR operation between the two values. */
@SymbolName("Kotlin_Byte_or_Byte")
external public infix fun or(other: Byte): Byte
/** Performs a bitwise XOR operation between the two values. */
@SymbolName("Kotlin_Byte_xor_Byte")
external public infix fun xor(other: Byte): Byte
/** Inverts the bits in this value/ */
@SymbolName("Kotlin_Byte_inv")
external public fun inv(): Byte
@SymbolName("Kotlin_Byte_toByte")
external public override fun toByte(): Byte
@SymbolName("Kotlin_Byte_toChar")
@@ -413,19 +400,6 @@ public final class Short : Number(), Comparable<Short> {
@SymbolName("Kotlin_Short_unaryMinus")
external public operator fun unaryMinus(): Int
/** Performs a bitwise AND operation between the two values. */
@SymbolName("Kotlin_Short_and_Short")
external public infix fun and(other: Short): Short
/** Performs a bitwise OR operation between the two values. */
@SymbolName("Kotlin_Short_or_Short")
external public infix fun or(other: Short): Short
/** Performs a bitwise XOR operation between the two values. */
@SymbolName("Kotlin_Short_xor_Short")
external public infix fun xor(other: Short): Short
/** Inverts the bits in this value/ */
@SymbolName("Kotlin_Short_inv")
external public fun inv(): Short
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): IntRange {
return IntRange(this.toInt(), other.toInt())
@@ -1016,14 +1016,6 @@ public actual fun CharArray.contentHashCode(): Int {
return result
}
// From Library.kt.
/**
* Returns an array of objects of the given type with the given [size], initialized with null values.
*/
public inline fun <reified @PureReifiable T> arrayOfNulls(size: Int): Array<T?> =
@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
arrayOfUninitializedElements<T?>(size)
// From JS collections.kt.
internal actual fun <T> arrayOfNulls(reference: Array<T>, size: Int): Array<T> {
return arrayOfNulls<Any>(size) as Array<T>