Make subarrayContentToString internal
This commit is contained in:
committed by
Space Team
parent
937a14146a
commit
2100f08655
@@ -160,7 +160,7 @@ actual class ArrayList<E> private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return backingArray.subarrayContentToStringImpl(offset, length)
|
return backingArray.subarrayContentToString(offset, length)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
|||||||
@@ -18,22 +18,12 @@ internal fun checkCopyOfRangeArguments(fromIndex: Int, toIndex: Int, size: Int)
|
|||||||
throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).")
|
throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@kotlin.internal.InlineOnly
|
||||||
// TODO: internal
|
@PublishedApi
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of the contents of the subarray of the specified array as if it is [List].
|
* Returns a string representation of the contents of the subarray of the specified array as if it is [List].
|
||||||
*/
|
*/
|
||||||
@kotlin.internal.InlineOnly
|
internal inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String {
|
||||||
@Deprecated("This function will become internal soon.")
|
|
||||||
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.7")
|
|
||||||
public inline fun <T> Array<out T>.subarrayContentToString(offset: Int, length: Int): String {
|
|
||||||
return subarrayContentToStringImpl(offset, length)
|
|
||||||
}
|
|
||||||
|
|
||||||
@kotlin.internal.InlineOnly
|
|
||||||
@PublishedApi
|
|
||||||
// TODO: Rename back to subarrayContentToString after dropping that public function
|
|
||||||
internal inline fun <T> Array<out T>.subarrayContentToStringImpl(offset: Int, length: Int): String {
|
|
||||||
val sb = StringBuilder(2 + length * 3)
|
val sb = StringBuilder(2 + length * 3)
|
||||||
sb.append("[")
|
sb.append("[")
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user