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.
1 parent b6a614c commit e793e0eCopy full SHA for e793e0e
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