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.
2 parents 295204d + 208b8d4 commit 31b44c8Copy full SHA for 31b44c8
stdlib/public/core/TemporaryAllocation.swift
@@ -38,7 +38,7 @@ internal func _byteCountForTemporaryAllocation<T>(
38
// emitting equivalent compile-time diagnostics because the call to
39
// Builtin.stackAlloc() becomes unreachable.
40
if _isComputed(capacity) {
41
- _precondition(capacity > 0, "Allocation capacity must be greater than or equal to zero")
+ _precondition(capacity >= 0, "Allocation capacity must be greater than or equal to zero")
42
}
43
let stride = MemoryLayout<T>.stride
44
let (byteCount, overflow) = capacity.multipliedReportingOverflow(by: stride)
0 commit comments