Skip to content

Commit 2607428

Browse files
committed
[stdlib] U[M]RBP.count: Let the compiler assume that the result is nonnegative
1 parent 27978d1 commit 2607428

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ extension Unsafe${Mutable}RawBufferPointer: ${Mutable}Collection {
253253
@inlinable
254254
public var count: Int {
255255
if let pos = _position {
256-
return _end! - pos
256+
return _assumeNonNegative(_end! - pos)
257257
}
258258
return 0
259259
}

0 commit comments

Comments
 (0)