Skip to content

Commit 6d9c797

Browse files
committed
Cleanup
1 parent 3b8ee5d commit 6d9c797

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/native/src/Instant.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ public actual fun Instant.periodUntil(other: Instant, timeZone: TimeZone): DateT
219219
val initialLdt = toLocalDateTimeFailing(initialOffset)
220220
val otherLdt = other.toLocalDateTimeFailing(other.offsetIn(timeZone))
221221

222-
val months = initialLdt.until(otherLdt, DateTimeUnit.MONTH).toLong().toInt() // `until` on dates never fails
222+
val months = initialLdt.until(otherLdt, DateTimeUnit.MONTH) // `until` on dates never fails
223223
val ldtWithMonths = initialLdt.plus(months, DateTimeUnit.MONTH) // won't throw: thisLdt + months <= otherLdt, which is known to be valid
224-
val days = ldtWithMonths.until(otherLdt, DateTimeUnit.DAY).toLong().toInt() // `until` on dates never fails
224+
val days = ldtWithMonths.until(otherLdt, DateTimeUnit.DAY) // `until` on dates never fails
225225
val newInstant = timeZone.localDateTimeToInstant(ldtWithMonths.plus(days, DateTimeUnit.DAY), preferred = initialOffset) // won't throw: thisLdt + days <= otherLdt
226226
val nanoseconds = newInstant.until(other, DateTimeUnit.NANOSECOND) // |otherLdt - thisLdt| < 24h
227227

0 commit comments

Comments
 (0)