Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
@Suppress("NOTHING_TO_INLINE") -> @kotlin.internal.InlineOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Abduqodiri Qurbonzoda committed Dec 3, 2019
1 parent cd4dcec commit 938da9a
Showing 1 changed file with 50 additions and 24 deletions.
74 changes: 50 additions & 24 deletions runtime/src/main/kotlin/kotlin/text/StringBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public actual fun StringBuilder.clear(): StringBuilder = apply { setLength(0) }
*
* @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.set(index, value)

Expand All @@ -681,7 +681,8 @@ public actual inline operator fun StringBuilder.set(index: Int, value: Char): Un
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.setRange(startIndex: Int, endIndex: Int, value: String): StringBuilder =
this.setRange(startIndex, endIndex, value)

Expand All @@ -696,7 +697,8 @@ public actual inline fun StringBuilder.setRange(startIndex: Int, endIndex: Int,
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.deleteAt(index: Int): StringBuilder = this.deleteAt(index)

/**
Expand All @@ -709,7 +711,8 @@ public actual inline fun StringBuilder.deleteAt(index: Int): StringBuilder = thi
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.deleteRange(startIndex: Int, endIndex: Int): StringBuilder = this.deleteRange(startIndex, endIndex)

/**
Expand All @@ -726,7 +729,8 @@ public actual inline fun StringBuilder.deleteRange(startIndex: Int, endIndex: In
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE", "ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length) =
this.toCharArray(destination, destinationOffset, startIndex, endIndex)

Expand All @@ -743,7 +747,8 @@ public actual inline fun StringBuilder.toCharArray(destination: CharArray, desti
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.appendRange(value: CharArray, startIndex: Int, endIndex: Int): StringBuilder =
this.appendRange(value, startIndex, endIndex)

Expand All @@ -759,7 +764,8 @@ public actual inline fun StringBuilder.appendRange(value: CharArray, startIndex:
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.appendRange(value: CharSequence?, startIndex: Int, endIndex: Int): StringBuilder =
this.appendRange(value, startIndex, endIndex)

Expand All @@ -778,7 +784,8 @@ public actual inline fun StringBuilder.appendRange(value: CharSequence?, startIn
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.insertRange(index: Int, value: CharArray, startIndex: Int, endIndex: Int): StringBuilder =
this.insertRange(index, value, startIndex, endIndex)

Expand All @@ -798,7 +805,8 @@ public actual inline fun StringBuilder.insertRange(index: Int, value: CharArray,
*/
@SinceKotlin("1.3")
@ExperimentalStdlibApi
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public actual inline fun StringBuilder.insertRange(index: Int, value: CharSequence?, startIndex: Int, endIndex: Int): StringBuilder =
this.insertRange(index, value, startIndex, endIndex)

Expand All @@ -809,33 +817,42 @@ public actual inline fun StringBuilder.insertRange(index: Int, value: CharSequen
* The overall effect is exactly as if the boolean [it] were converted to a string by the `boolean.toString()` method,
* and then that string was appended to this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Boolean): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Byte): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Short): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Int): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Long): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Float): StringBuilder = this.append(value = it)
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: Double): StringBuilder = this.append(value = it)

/**
* Appends the specified string [it] to this string builder and returns this instance.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: String): StringBuilder = this.append(value = it)

/**
* Appends characters in the specified [CharArray] [it] to this string builder and returns this instance.
*
* Characters are appended in order, starting at the index 0.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.append(it: CharArray): StringBuilder = this.append(value = it)

/**
Expand All @@ -844,15 +861,17 @@ public inline fun StringBuilder.append(it: CharArray): StringBuilder = this.appe
* If the current capacity is less than the specified [capacity], a new backing storage is allocated with greater capacity.
* Otherwise, this method takes no action and simply returns.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.ensureCapacity(capacity: Int): Unit = this.ensureCapacity(minimumCapacity = capacity)

/**
* Inserts the specified character char [c] into this string builder at the specified [index] and returns this instance.
*
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.insert(index: Int, c: Char): StringBuilder = this.insert(index, value = c)

/**
Expand All @@ -862,7 +881,8 @@ public inline fun StringBuilder.insert(index: Int, c: Char): StringBuilder = thi
*
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.insert(index: Int, chars: CharArray): StringBuilder = this.insert(index, value = chars)

/**
Expand All @@ -875,15 +895,17 @@ public inline fun StringBuilder.insert(index: Int, chars: CharArray): StringBuil
*
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.insert(index: Int, csq: CharSequence?): StringBuilder = this.insert(index, value = csq)

/**
* Inserts the [string] into this string builder at the specified [index] and returns this instance.
*
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.insert(index: Int, string: String): StringBuilder = this.insert(index, value = string)

// Method renamings
Expand All @@ -902,6 +924,7 @@ public inline fun StringBuilder.insert(index: Int, string: String): StringBuilde
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
*/
@UseExperimental(ExperimentalStdlibApi::class)
@kotlin.internal.InlineOnly
public inline fun StringBuilder.insert(index: Int, csq: CharSequence?, start: Int, end: Int): StringBuilder =
this.insertRange(index, csq, start, end)

Expand All @@ -916,7 +939,8 @@ public inline fun StringBuilder.insert(index: Int, csq: CharSequence?, start: In
*
* @throws IndexOutOfBoundsException or [IllegalArgumentException] if [l] is less than zero.
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
@kotlin.internal.InlineOnly
public inline fun StringBuilder.setLength(l: Int) = this.setLength(newLength = l)

/**
Expand All @@ -925,6 +949,7 @@ public inline fun StringBuilder.setLength(l: Int) = this.setLength(newLength = l
* @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.
*/
@UseExperimental(ExperimentalStdlibApi::class)
@kotlin.internal.InlineOnly
public inline fun StringBuilder.setCharAt(index: Int, value: Char) = this.set(index, value)

/**
Expand All @@ -937,4 +962,5 @@ public inline fun StringBuilder.setCharAt(index: Int, value: Char) = this.set(in
* @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.
*/
@UseExperimental(ExperimentalStdlibApi::class)
@kotlin.internal.InlineOnly
public inline fun StringBuilder.deleteCharAt(index: Int) = this.deleteAt(index)

0 comments on commit 938da9a

Please sign in to comment.