Skip to content

Commit

Permalink
Simplify cast
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Conte Mac Donell <[email protected]>
  • Loading branch information
Reflejo committed Aug 15, 2022
1 parent 6439769 commit 04af0b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/NTPPacket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ struct NTPPacket {
// MARK: - Private helpers

private func dateToNTPFormat(_ time: TimeInterval) -> UInt64 {
let integer = UInt32(UInt64(time + kEpochDelta) & 0xffffffff)
let integer = UInt64(time + kEpochDelta) & 0xffffffff
let decimal = modf(time).1 * 4294967296.0 // 2 ^ 32
return UInt64(integer) << 32 | UInt64(decimal)
return integer << 32 | UInt64(decimal)
}

private func intervalToNTPFormat(_ time: TimeInterval) -> UInt32 {
Expand Down

0 comments on commit 04af0b2

Please sign in to comment.