Skip to content

Commit 95ce270

Browse files
committed
Get rid of remaining uses of precondition
1 parent b059766 commit 95ce270

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

stdlib/public/core/Int128.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ extension Int128 {
294294
public func dividedReportingOverflow(
295295
by other: Self
296296
) -> (partialValue: Self, overflow: Bool) {
297-
precondition(other != .zero, "Division by zero")
297+
_precondition(other != .zero, "Division by zero")
298298
if self == .min && other == -1 { return (.min, true) }
299299
return (Self(Builtin.sdiv_Int128(self._value, other._value)), false)
300300
}
@@ -304,7 +304,7 @@ extension Int128 {
304304
public func remainderReportingOverflow(
305305
dividingBy other: Self
306306
) -> (partialValue: Self, overflow: Bool) {
307-
precondition(other != .zero, "Remainder dividing by zero.")
307+
_precondition(other != .zero, "Division by zero in remainer operation")
308308
if self == .min && other == -1 { return (0, true) }
309309
return (Self(Builtin.srem_Int128(self._value, other._value)), false)
310310
}

stdlib/public/core/UInt128.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ extension UInt128.Words: RandomAccessCollection {
505505
public subscript(position: Int) -> UInt {
506506
@inlinable
507507
get {
508-
precondition(position >= 0 && position < count)
508+
_precondition(position >= 0 && position < count, "Index out of bounds")
509509
var value = _value
510510
#if _endian(little)
511511
let index = position

0 commit comments

Comments
 (0)