Skip to content

Commit 5f268cc

Browse files
authored
Merge pull request #38970 from Catfish-Man/ask-only-for-what-you-need
Avoid an unnecessary call to CFStringGetCharactersPtr in bridging
2 parents 4361da6 + 834e82b commit 5f268cc

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)