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.
1 parent 53b6b45 commit cb39014Copy full SHA for cb39014
stdlib/public/core/Span/MutableRawSpan.swift
@@ -109,7 +109,8 @@ extension MutableRawSpan {
109
let (start, count) = unsafe (elements._pointer, elements._count)
110
let span = unsafe MutableRawSpan(
111
_unchecked: start,
112
- byteCount: count &* MemoryLayout<Element>.stride
+ byteCount: count == 1 ? MemoryLayout<Element>.size
113
+ : count &* MemoryLayout<Element>.stride
114
)
115
self = unsafe _overrideLifetime(span, mutating: &elements)
116
}
0 commit comments