Skip to content

Commit 208b8d4

Browse files
committed
Fix incorrect precondition test (gt instead of gte) in TemporaryAllocation.swift
1 parent 48a23a8 commit 208b8d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/TemporaryAllocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal func _byteCountForTemporaryAllocation<T>(
3838
// emitting equivalent compile-time diagnostics because the call to
3939
// Builtin.stackAlloc() becomes unreachable.
4040
if _isComputed(capacity) {
41-
_precondition(capacity > 0, "Allocation capacity must be greater than or equal to zero")
41+
_precondition(capacity >= 0, "Allocation capacity must be greater than or equal to zero")
4242
}
4343
let stride = MemoryLayout<T>.stride
4444
let (byteCount, overflow) = capacity.multipliedReportingOverflow(by: stride)

0 commit comments

Comments
 (0)