Replaced sure() invocations with '!!' operator in libraries written on Kotlin.
This commit is contained in:
@@ -172,7 +172,7 @@ public inline fun <T> Array<T>.foldRight(initial: T, operation: (T, T) -> T): T
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun <T> Array<T>.reduce(operation: (T, T) -> T): T {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <T, K> Array<T>.groupByTo(result: MutableMap<K, MutableList<T>
|
||||
public inline fun <T> Array<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun BooleanArray.foldRight(initial: Boolean, operation: (Boolean,
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun BooleanArray.reduce(operation: (Boolean, Boolean) -> Boolean): Boolean {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> BooleanArray.groupByTo(result: MutableMap<K, MutableList<B
|
||||
public inline fun BooleanArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun ByteArray.foldRight(initial: Byte, operation: (Byte, Byte) ->
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun ByteArray.reduce(operation: (Byte, Byte) -> Byte): Byte {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> ByteArray.groupByTo(result: MutableMap<K, MutableList<Byte
|
||||
public inline fun ByteArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun CharArray.foldRight(initial: Char, operation: (Char, Char) ->
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun CharArray.reduce(operation: (Char, Char) -> Char): Char {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> CharArray.groupByTo(result: MutableMap<K, MutableList<Char
|
||||
public inline fun CharArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun DoubleArray.foldRight(initial: Double, operation: (Double, Dou
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun DoubleArray.reduce(operation: (Double, Double) -> Double): Double {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> DoubleArray.groupByTo(result: MutableMap<K, MutableList<Do
|
||||
public inline fun DoubleArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun FloatArray.foldRight(initial: Float, operation: (Float, Float)
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun FloatArray.reduce(operation: (Float, Float) -> Float): Float {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> FloatArray.groupByTo(result: MutableMap<K, MutableList<Flo
|
||||
public inline fun FloatArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun IntArray.foldRight(initial: Int, operation: (Int, Int) -> Int)
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun IntArray.reduce(operation: (Int, Int) -> Int): Int {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> IntArray.groupByTo(result: MutableMap<K, MutableList<Int>>
|
||||
public inline fun IntArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -171,7 +171,7 @@ public inline fun <T> Iterator<T>.foldRight(initial: T, operation: (T, T) -> T):
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun <T> Iterator<T>.reduce(operation: (T, T) -> T): T {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public inline fun <T, K> Iterator<T>.groupByTo(result: MutableMap<K, MutableList
|
||||
public inline fun <T> Iterator<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun LongArray.foldRight(initial: Long, operation: (Long, Long) ->
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun LongArray.reduce(operation: (Long, Long) -> Long): Long {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> LongArray.groupByTo(result: MutableMap<K, MutableList<Long
|
||||
public inline fun LongArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
@@ -172,7 +172,7 @@ public inline fun ShortArray.foldRight(initial: Short, operation: (Short, Short)
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reduce
|
||||
*/
|
||||
public inline fun ShortArray.reduce(operation: (Short, Short) -> Short): Short {
|
||||
val iterator = this.iterator().sure()
|
||||
val iterator = this.iterator()!!
|
||||
if (!iterator.hasNext()) {
|
||||
throw UnsupportedOperationException("Empty iterable can't be reduced")
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public inline fun <K> ShortArray.groupByTo(result: MutableMap<K, MutableList<Sho
|
||||
public inline fun ShortArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
appendString(buffer, separator, prefix, postfix, limit, truncated)
|
||||
return buffer.toString().sure()
|
||||
return buffer.toString()!!
|
||||
}
|
||||
|
||||
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
|
||||
|
||||
Reference in New Issue
Block a user