We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f16272 commit 56ed11eCopy full SHA for 56ed11e
stdlib/public/core/Bit.swift
@@ -94,12 +94,12 @@ public func < (lhs: Bit, rhs: Bit) -> Bool {
94
}
95
96
extension Bit : IntegerArithmeticType {
97
- static func _withOverflow(v: (Int, overflow: Bool)) -> (Bit, overflow: Bool) {
98
- if let b = Bit(rawValue: v.0) {
99
- return (b, v.overflow)
+ static func _withOverflow(intResult: Int, overflow: Bool) -> (Bit, overflow: Bool) {
+ if let bit = Bit(rawValue: intResult) {
+ return (bit, overflow)
100
} else {
101
- let bitRaw = v.0 > 0 ? v.0 % 2 : v.0 % 2 + 2
102
- return (Bit(rawValue: bitRaw)!, true)
+ let bitRaw = intResult > 0 ? intResult % 2 : intResult % 2 + 2
+ return (Bit(rawValue: bitRaw)!, overflow: true)
103
104
105
0 commit comments