From 04af0b20f29cc4804cf54ed57382b4bcee893ee6 Mon Sep 17 00:00:00 2001 From: Martin Conte Mac Donell Date: Mon, 15 Aug 2022 10:33:15 -0700 Subject: [PATCH] Simplify cast Signed-off-by: Martin Conte Mac Donell --- Sources/NTPPacket.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/NTPPacket.swift b/Sources/NTPPacket.swift index cf3e13b..72eecb3 100644 --- a/Sources/NTPPacket.swift +++ b/Sources/NTPPacket.swift @@ -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 {