Skip to content

Commit 524f499

Browse files
committed
[stdlib] Duration: match parameter order in direct initializer with _Int128
1 parent c00322d commit 524f499

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stdlib/public/core/Duration.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public struct Duration: Sendable {
4343
internal var _high: Int64
4444

4545
@inlinable
46-
internal init(_low: UInt64, high: Int64) {
47-
self._low = _low
48-
self._high = high
46+
internal init(_high: Int64, low: UInt64) {
47+
self._low = low
48+
self._high = _high
4949
}
5050

5151
internal init(_attoseconds: _Int128) {
52-
self.init(_low: _attoseconds.low, high: _attoseconds.high)
52+
self.init(_high: _attoseconds.high, low: _attoseconds.low)
5353
}
5454

5555
/// Construct a `Duration` by adding attoseconds to a seconds value.
@@ -193,15 +193,15 @@ extension Duration {
193193
}
194194

195195
@available(SwiftStdlib 5.7, *)
196-
extension Duration: Codable {
196+
extension Duration: Codable {
197197
@available(SwiftStdlib 5.7, *)
198198
public init(from decoder: Decoder) throws {
199199
var container = try decoder.unkeyedContainer()
200200
let high = try container.decode(Int64.self)
201201
let low = try container.decode(UInt64.self)
202-
self.init(_attoseconds: _Int128(high: high, low: low))
202+
self.init(_high: high, low: low)
203203
}
204-
204+
205205
@available(SwiftStdlib 5.7, *)
206206
public func encode(to encoder: Encoder) throws {
207207
var container = encoder.unkeyedContainer()
@@ -211,7 +211,7 @@ extension Duration: Codable {
211211
}
212212

213213
@available(SwiftStdlib 5.7, *)
214-
extension Duration: Hashable {
214+
extension Duration: Hashable {
215215
@available(SwiftStdlib 5.7, *)
216216
public func hash(into hasher: inout Hasher) {
217217
hasher.combine(_attoseconds)

0 commit comments

Comments
 (0)