Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Feb 10, 2020
1 parent 363d8a2 commit 38cd6da
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ object DateTimeUtils {

def microsToInstant(us: Long): Instant = {
val secs = Math.floorDiv(us, MICROS_PER_SECOND)
// Unfolded Math.floorMod(us, MICROS_PER_SECOND) to reuse the result of
// the above calculation of `secs` via `floorDiv`.
val mos = us - secs * MICROS_PER_SECOND
Instant.ofEpochSecond(secs, mos * NANOS_PER_MICROS)
}
Expand Down

0 comments on commit 38cd6da

Please sign in to comment.