Skip to content

Commit c2476f4

Browse files
author
Max Moiseev
committed
[overlay] Potentially better bridging to NSString in StringProtocol extensions
(cherry picked from commit 77edc65)
1 parent d7e4d20 commit c2476f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/SDK/Foundation/NSStringAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ extension StringProtocol where Index == String.Index {
414414
/// The corresponding `NSString` - a convenience for bridging code.
415415
// FIXME(strings): There is probably a better way to bridge Self to NSString
416416
var _ns: NSString {
417-
return String(self) as NSString
417+
return self._ephemeralString as NSString
418418
}
419419

420420
/// Return an `Index` corresponding to the given offset in our UTF-16

0 commit comments

Comments
 (0)