Skip to content

Commit de340a7

Browse files
committed
[stdlib] remove a repetition
1 parent 4d23610 commit de340a7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

stdlib/public/core/StringUTF8View.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,7 @@ extension String.UTF8View {
337337
#if _runtime(_ObjC)
338338
// handle non-UTF8 Objective-C bridging cases here
339339
if !_guts.isFastUTF8 && _guts._object.hasObjCBridgeableObject {
340-
let storage: __StringStorage
341-
if let associated = _guts.getAssociatedStorage() {
342-
storage = associated
343-
}
344-
else {
345-
storage = _guts.getOrAllocateAssociatedStorage()
346-
}
340+
let storage = _guts.getOrAllocateAssociatedStorage()
347341
let (start, count) = unsafe (storage.start, storage.count)
348342
let span = unsafe Span(_unsafeStart: start, count: count)
349343
return unsafe _overrideLifetime(span, borrowing: self)

0 commit comments

Comments
 (0)