Advance max/min(By/With) deprecation level to ERROR
This commit is contained in:
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val max: Int? = list.<caret>filter { it > 1 }.max()
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val max: Int? = list.asSequence().filter { it > 1 }.max()
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxBy: Int? = list.<caret>filter { it > 1 }.maxBy { true }
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxBy: Int? = list.asSequence().filter { it > 1 }.maxBy { true }
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxWith: Int? = list.<caret>filter { it > 1 }.maxWith(Comparator { o1, o2 -> 0 })
|
||||
}
|
||||
idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/maxWith.kt.after
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxWith: Int? = list.asSequence().filter { it > 1 }.maxWith(Comparator { o1, o2 -> 0 })
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val min: Int? = list.<caret>filter { it > 1 }.min()
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val min: Int? = list.asSequence().filter { it > 1 }.min()
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val minBy: Int? = list.<caret>filter { it > 1 }.minBy { true }
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val minBy: Int? = list.asSequence().filter { it > 1 }.minBy { true }
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxWith: Int? = list.<caret>filter { it > 1 }.maxWith(Comparator { o1, o2 -> 0 })
|
||||
}
|
||||
idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/minWith.kt.after
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
val maxWith: Int? = list.asSequence().filter { it > 1 }.maxWith(Comparator { o1, o2 -> 0 })
|
||||
}
|
||||
+1
-1
@@ -3,5 +3,5 @@ fun test(list: List<String>) {
|
||||
list
|
||||
// comment
|
||||
.<caret>asSequence()
|
||||
.max()
|
||||
.maxOrNull()
|
||||
}
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
fun test(list: List<String>) {
|
||||
list
|
||||
// comment
|
||||
.max()
|
||||
.maxOrNull()
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).maxBy { it.second }!!
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).maxByOrNull { it.second }!!
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).maxBy { it.second }
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).maxByOrNull { it.second }
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).minBy { it.second }!!
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).minByOrNull { it.second }!!
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).minBy { it.second }
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).minByOrNull { it.second }
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).minBy { it.second }!!
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).minByOrNull { it.second }!!
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).minBy { it.second }
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).minByOrNull { it.second }
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).maxBy { it.second }!!
|
||||
val x: Pair<String, Int> = listOf("a" to 1, "c" to 3, "b" to 2).maxByOrNull { it.second }!!
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).maxBy { it.second }
|
||||
val x = listOf("a" to 1, "c" to 3, "b" to 2).maxByOrNull { it.second }
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Int = listOf(1, 3, 2).max()!!
|
||||
val x: Int = listOf(1, 3, 2).maxOrNull()!!
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf(1, 3, 2).max()
|
||||
val x = listOf(1, 3, 2).maxOrNull()
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Int = listOf(1, 3, 2).min()!!
|
||||
val x: Int = listOf(1, 3, 2).minOrNull()!!
|
||||
idea/testData/inspectionsLocal/collections/simplifiableCallChain/sortedDescendingLastOrNull.kt.after
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf(1, 3, 2).min()
|
||||
val x = listOf(1, 3, 2).minOrNull()
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Int = listOf(1, 3, 2).min()!!
|
||||
val x: Int = listOf(1, 3, 2).minOrNull()!!
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf(1, 3, 2).min()
|
||||
val x = listOf(1, 3, 2).minOrNull()
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x: Int = listOf(1, 3, 2).max()!!
|
||||
val x: Int = listOf(1, 3, 2).maxOrNull()!!
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
// WITH_RUNTIME
|
||||
val x = listOf(1, 3, 2).max()
|
||||
val x = listOf(1, 3, 2).maxOrNull()
|
||||
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.maxOrNull()'"
|
||||
fun f(list: List<Int>) {
|
||||
var result = -1
|
||||
<caret>for (item in list)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.maxOrNull()'"
|
||||
fun f(list: List<Int>) {
|
||||
val <caret>result = list
|
||||
.filter { it % 2 == 0 }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: -1
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'filter{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filter{}.maxOrNull()'"
|
||||
fun f(list: List<Int>) {
|
||||
val <caret>result = list
|
||||
.asSequence()
|
||||
.filter { it % 2 == 0 }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: -1
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
var max_width = 0.0f
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
var max_width = 0.0f
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
var max_width = 0.0f
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(lineCount: Int): Float {
|
||||
val <caret>max_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0f
|
||||
return max_width
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'max()'"
|
||||
// INTENTION_TEXT: "Replace with 'maxOrNull()'"
|
||||
// IS_APPLICABLE_2: false
|
||||
fun getMaxLineWidth(list: List<Float>): Float {
|
||||
var max = 0.0f
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'max()'"
|
||||
// INTENTION_TEXT: "Replace with 'maxOrNull()'"
|
||||
// IS_APPLICABLE_2: false
|
||||
fun getMaxLineWidth(list: List<Float>): Float {
|
||||
val <caret>max = list.max()
|
||||
val <caret>max = list.maxOrNull()
|
||||
?: 0.0f
|
||||
return max
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
var max = 0.0
|
||||
<caret>for (i in 0..count-1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
val max = (0..count-1)
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return max
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
val max = (0..count-1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return max
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(list: List<Double>): Double {
|
||||
var max = 0.0
|
||||
<caret>for ((i, item) in list.withIndex()) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(list: List<Double>): Double {
|
||||
val <caret>max = list
|
||||
.mapIndexed { i, item -> item * i }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return max
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'mapIndexed{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().mapIndexed{}.maxOrNull()'"
|
||||
fun getMaxLineWidth(list: List<Double>): Double {
|
||||
val <caret>max = list
|
||||
.asSequence()
|
||||
.mapIndexed { i, item -> item * i }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return max
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
import java.lang.Math.max
|
||||
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
import java.lang.Math.max
|
||||
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
val <caret>m = (0..count-1)
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return m
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.max()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.max()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.maxOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.maxOrNull()'"
|
||||
import java.lang.Math.max
|
||||
|
||||
fun getMaxLineWidth(count: Int): Double {
|
||||
val <caret>m = (0..count-1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.max()
|
||||
.maxOrNull()
|
||||
?: 0.0
|
||||
return m
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
var min_width = Double.MAX_VALUE
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
var min_width = Double.MAX_VALUE
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
var min_width = Double.MAX_VALUE
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
var min_width = Double.MAX_VALUE
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
var min_width = Double.MAX_VALUE
|
||||
<caret>for (i in 0..lineCount - 1) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'map{}.min()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.min()'"
|
||||
// INTENTION_TEXT: "Replace with 'map{}.minOrNull()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.minOrNull()'"
|
||||
fun getMinLineWidth(lineCount: Int): Double {
|
||||
val <caret>min_width = (0..lineCount - 1)
|
||||
.asSequence()
|
||||
.map { getLineWidth(it) }
|
||||
.min()
|
||||
.minOrNull()
|
||||
?: Double.MAX_VALUE
|
||||
return min_width
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@
|
||||
fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection<String>? {
|
||||
val groupsByLength = collection.groupBy { s -> { s.length } }
|
||||
|
||||
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
|
||||
val maximumSizeOfGroup = groupsByLength.values.maxByOrNull { it.size }.
|
||||
return groupsByLength.values.firstOrNull { group -> {group.size == <caret>maximumSizeOfGroup} }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user