Skip to content

Commit 52f9c77

Browse files
committed
Revert "Remove unnecessary _fixLifetime"
This reverts commit ce17877.
1 parent ce17877 commit 52f9c77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/StringCreate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ extension String {
124124
// we use it directly. This could be a little faster, but this error path
125125
// shouldn't be perf-sensitive anyway.
126126
let temporaryCodeUnits = Array(result.codeUnits)
127+
defer { _fixLifetime(temporaryCodeUnits) }
127128
return temporaryCodeUnits.withContiguousStorageIfAvailable {
128129
//This could be optimized to use excess tail capacity
129130
return repairUTF8($0, firstKnownBrokenRange: initialRange)

0 commit comments

Comments
 (0)