File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Sources/DistributedCluster
Tests/DistributedClusterTests Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -45,15 +45,14 @@ extension TimeSpec {
4545 @usableFromInline
4646 internal static func + ( a: timespec , b: timespec ) -> timespec {
4747 let totalNanos = a. toNanos ( ) + b. toNanos ( )
48- let seconds = totalNanos / NANOS
4948 var result = timespec ( )
50- result. tv_sec = seconds
51- result. tv_nsec = totalNanos % NANOS
49+ result. tv_sec = Int ( totalNanos / Int64 ( NANOS ) )
50+ result. tv_nsec = Int ( totalNanos % Int64 ( NANOS) )
5251 return result
5352 }
5453
5554 @usableFromInline
56- internal func toNanos( ) -> Int {
57- self . tv_nsec + ( self . tv_sec * NANOS)
55+ internal func toNanos( ) -> Int64 {
56+ Int64 ( self . tv_nsec) + ( Int64 ( self . tv_sec) * Int64 ( NANOS) )
5857 }
5958}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class TimeSpecTests: XCTestCase {
3838 }
3939
4040 func test_timeSpecShouldBeCreatedProperlyFromDuration( ) {
41- self . total. toNanos ( ) . shouldEqual ( Int ( self . totalDuration. nanoseconds) )
41+ self . total. toNanos ( ) . shouldEqual ( Int64 ( self . totalDuration. nanoseconds) )
4242 self . total. tv_sec. shouldEqual ( Int ( self . totalDuration. nanoseconds) / NANOS)
4343 self . total. tv_nsec. shouldEqual ( Int ( self . totalDuration. nanoseconds) % NANOS)
4444 }
You can’t perform that action at this time.
0 commit comments