Revert "[NI] Prefer between two complex variables one with proper lower bounds"

This reverts commit ced8a92629.
This commit is contained in:
Mikhail Zarechenskiy
2020-03-18 16:23:54 +03:00
parent f82e2db65d
commit d4d35bb766
12 changed files with 3 additions and 135 deletions
@@ -1,20 +0,0 @@
// FIR_IDENTICAL
// FULL_JDK
import java.time.LocalDate
data class DailyTime(val date: LocalDate)
fun <T : Comparable<T>> Sequence<T>.range(): ClosedRange<T>? {
val iter = iterator()
return when {
iter.hasNext() -> iter.next().let { it..it }
else -> null
}
}
fun test(dailyTimes: List<DailyTime>): List<DailyTime> {
val dateRange = dailyTimes.asSequence().map { it.date }.range() ?: return emptyList()
println(dateRange.start)
return dailyTimes
}