Skip to content

Commit d886836

Browse files
committed
Cleanup
1 parent 6b76328 commit d886836

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
@@ -321,9 +321,9 @@ public actual fun Instant.periodUntil(other: Instant, timeZone: TimeZone): DateT
321321
val initialLdt = toLocalDateTimeFailing(initialOffset)
322322
val otherLdt = other.toLocalDateTimeFailing(other.offsetIn(timeZone))
323323

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

0 commit comments

Comments
 (0)