Reformat stdlib: common code

#KT-5558
This commit is contained in:
Ilya Gorbunov
2018-04-20 21:32:58 +03:00
parent ad43c0f4cb
commit c53a2d57c3
23 changed files with 234 additions and 201 deletions
@@ -16,7 +16,7 @@ import kotlin.coroutines.experimental.Continuation
*/
@SinceKotlin("1.1")
public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrReturn(
completion: Continuation<T>
completion: Continuation<T>
): Any?
/**
@@ -28,17 +28,17 @@ public expect inline fun <T> (suspend () -> T).startCoroutineUninterceptedOrRetu
*/
@SinceKotlin("1.1")
public expect inline fun <R, T> (suspend R.() -> T).startCoroutineUninterceptedOrReturn(
receiver: R,
completion: Continuation<T>
receiver: R,
completion: Continuation<T>
): Any?
@SinceKotlin("1.1")
public expect fun <T> (suspend () -> T).createCoroutineUnchecked(
completion: Continuation<T>
completion: Continuation<T>
): Continuation<Unit>
@SinceKotlin("1.1")
public expect fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
receiver: R,
completion: Continuation<T>
receiver: R,
completion: Continuation<T>
): Continuation<Unit>
@@ -345,6 +345,7 @@ public expect fun sign(x: Double): Double
*/
@SinceKotlin("1.2")
public expect fun min(a: Double, b: Double): Double
/**
* Returns the greater of two values.
*
@@ -432,6 +433,7 @@ public expect val Double.ulp: Double
*/
@SinceKotlin("1.2")
public expect fun Double.nextUp(): Double
/**
* Returns the [Double] value nearest to this value in direction of negative infinity.
*/
@@ -805,6 +807,7 @@ public expect fun sign(x: Float): Float
*/
@SinceKotlin("1.2")
public expect fun min(a: Float, b: Float): Float
/**
* Returns the greater of two values.
*
@@ -868,6 +871,7 @@ public expect val Float.sign: Float
*/
@SinceKotlin("1.2")
public expect fun Float.withSign(sign: Float): Float
/**
* Returns this value with the sign bit same as of the [sign] value.
*/
+12 -2
View File
@@ -109,20 +109,24 @@ public expect fun CharSequence.repeat(n: Int): String
* Returns a new string with all occurrences of [oldChar] replaced with [newChar].
*/
expect fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean = false): String
/**
* Returns a new string obtained by replacing all occurrences of the [oldValue] substring in this string
* with the specified [newValue] string.
*/
expect fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean = false): String
/**
* Returns a new string with the first occurrence of [oldChar] replaced with [newChar].
*/
expect fun String.replaceFirst(oldChar: Char, newChar: Char, ignoreCase: Boolean = false): String
/**
* Returns a new string obtained by replacing the first occurrence of the [oldValue] substring in this string
* with the specified [newValue] string.
*/
expect fun String.replaceFirst(oldValue: String, newValue: String, ignoreCase: Boolean = false): String
/**
* Returns `true` if this string is equal to [other], optionally ignoring character case.
*
@@ -143,8 +147,13 @@ expect fun CharSequence.isBlank(): Boolean
* @param otherOffset the start offset in the other char sequence of the substring to compare.
* @param length the length of the substring to compare.
*/
expect fun CharSequence.regionMatches(thisOffset: Int, other: CharSequence, otherOffset: Int, length: Int, ignoreCase: Boolean = false): Boolean
expect fun CharSequence.regionMatches(
thisOffset: Int,
other: CharSequence,
otherOffset: Int,
length: Int,
ignoreCase: Boolean = false
): Boolean
/**
@@ -228,4 +237,5 @@ expect fun String.toFloatOrNull(): Float?
@PublishedApi
internal expect fun checkRadix(radix: Int): Int
internal expect fun digitOf(char: Char, radix: Int): Int