Introduce minOrNull and maxOrNull extension functions #KT-39064
This commit is contained in:
@@ -71,7 +71,7 @@ public fun String.replaceIndent(newIndent: String = ""): String {
|
||||
val minCommonIndent = lines
|
||||
.filter(String::isNotBlank)
|
||||
.map(String::indentWidth)
|
||||
.min() ?: 0
|
||||
.minOrNull() ?: 0
|
||||
|
||||
return lines.reindent(length + newIndent.length * lines.size, getIndentFunction(newIndent), { line -> line.drop(minCommonIndent) })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user