I keep getting warnings about `timestampOffset` al...
# stdlib
z
I keep getting warnings about
timestampOffset
always being 0 here, but its not the case. Compiler bug?
Copy code
var minTimestamp: Long? = null
var maxTimestamp: Long? = null

journal.trainings.fastForEach { training ->
    val timestamp = training.timestamp.millis

    minTimestamp = minTimestamp?.coerceAtMost(timestamp) ?: timestamp
    maxTimestamp = maxTimestamp?.coerceAtLeast(timestamp) ?: timestamp

    ..
}

val timestampOffset = minTimestamp ?: 0L
val timeSpan = (maxTimestamp ?: timestampOffset) - timestampOffset // "Value of 'timestampOffset' is always zero"
j
Seems like you want #C7L3JB43G or #C0B8H786P (if it's an IDE inspection and not a compiler warning)
👍🏽 1
d
It's an IDE inspection, not a compiler warning
👍🏽 1