mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: Address StrictMemorySafety warnings in String related code.
This commit is contained in:
@@ -278,7 +278,7 @@ extension String {
|
||||
@_effects(readonly) @_semantics("string.getUTF8CString")
|
||||
get {
|
||||
if _fastPath(_guts.isFastUTF8) {
|
||||
var result = unsafe _guts.withFastCChar { ContiguousArray($0) }
|
||||
var result = unsafe _guts.withFastCChar { unsafe ContiguousArray($0) }
|
||||
result.append(0)
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user