Skip to content

Commit 83c14bc

Browse files
karwalorentey
authored andcommitted
Make raw buffer nil/count checks debug-mode only
1 parent 74a8254 commit 83c14bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ extension Unsafe${Mutable}RawBufferPointer {
432432
public init(
433433
@_nonEphemeral start: Unsafe${Mutable}RawPointer?, count: Int
434434
) {
435-
_precondition(count >= 0, "${Self} with negative count")
436-
_precondition(count == 0 || start != nil,
435+
_debugPrecondition(count >= 0, "${Self} with negative count")
436+
_debugPrecondition(count == 0 || start != nil,
437437
"${Self} has a nil start and nonzero count")
438438
_position = start
439439
_end = start.map { $0 + count }

0 commit comments

Comments
 (0)