We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4daac06 + e793e0e commit 2f6fb2dCopy full SHA for 2f6fb2d
stdlib/public/core/StringBridge.swift
@@ -351,7 +351,9 @@ internal func _bridgeTagged(
351
private func _NSStringASCIIPointer(_ str: _StringSelectorHolder) -> UnsafePointer<UInt8>? {
352
// TODO(String bridging): Is there a better interface here? Ideally we'd be
353
// able to ask for UTF8 rather than just ASCII
354
- return str._fastCStringContents(0)?._asUInt8
+ //TODO(String bridging): Unconditionally asking for nul-terminated contents is
355
+ // overly conservative and hurts perf with some NSStrings
356
+ return str._fastCStringContents(1)?._asUInt8
357
}
358
359
@_effects(readonly) // @opaque
0 commit comments