Skip to content

Commit 42efcdb

Browse files
committed
One more from @xwu + 80-column fixes
1 parent 2612e00 commit 42efcdb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

stdlib/public/core/Integers.swift.gyb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,7 +3374,9 @@ public struct DoubleWidth<Base : FixedWidthInteger> :
33743374
let result = DoubleWidth(extendingOrTruncating: product)
33753375

33763376
let isNegative = (self < (0 as DoubleWidth)) != (rhs < (0 as DoubleWidth))
3377-
let didCarry = isNegative ? carry != ~(0 as DoubleWidth) : carry != (0 as DoubleWidth)
3377+
let didCarry = isNegative
3378+
? carry != ~(0 as DoubleWidth)
3379+
: carry != (0 as DoubleWidth)
33783380
let hadPositiveOverflow = !isNegative &&
33793381
DoubleWidth.isSigned && product.leadingZeroBitCount == 0
33803382

@@ -3518,7 +3520,9 @@ public struct DoubleWidth<Base : FixedWidthInteger> :
35183520
return
35193521
}
35203522

3521-
if rhs._storage.high != 0 || rhs._storage.low >= DoubleWidth.bitWidth {
3523+
if rhs._storage.high != (0 as High) ||
3524+
rhs._storage.low >= DoubleWidth.bitWidth
3525+
{
35223526
lhs = 0
35233527
return
35243528
}
@@ -3548,8 +3552,10 @@ public struct DoubleWidth<Base : FixedWidthInteger> :
35483552

35493553
// Shift is exactly the width of `Base`, so high -> low.
35503554
if rhs._storage.low == Base.bitWidth {
3551-
lhs = DoubleWidth(
3552-
(lhs < (0 as DoubleWidth) ? ~0 : 0, Low(extendingOrTruncating: lhs._storage.high)))
3555+
lhs = DoubleWidth((
3556+
lhs < (0 as DoubleWidth) ? ~0 : 0,
3557+
Low(extendingOrTruncating: lhs._storage.high)
3558+
))
35533559
return
35543560
}
35553561

0 commit comments

Comments
 (0)