Skip to content

Commit 834e82b

Browse files
committed
Avoid an unnecessary call to CFStringGetCharactersPtr in bridging
1 parent 79b33ef commit 834e82b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stdlib/public/core/StringBridge.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,8 @@ private func _getCocoaStringPointer(
409409
if let ascii = stableCocoaASCIIPointer(cfImmutableValue) {
410410
return .ascii(ascii)
411411
}
412-
if let utf16Ptr = _stdlib_binary_CFStringGetCharactersPtr(cfImmutableValue) {
413-
return .utf16(utf16Ptr)
414-
}
412+
// We could ask for UTF16 here via _stdlib_binary_CFStringGetCharactersPtr,
413+
// but we currently have no use for it
415414
return .none
416415
}
417416

0 commit comments

Comments
 (0)