mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] String internal API review changes
I had to XFAIL test/ClangModules/cf.swift, which is failing for reasons I can't understand. <rdar://problem/16911496> Swift SVN r18071
This commit is contained in:
@@ -99,8 +99,7 @@ extension String {
|
||||
func withCString<Result>(
|
||||
f: (CString)->Result
|
||||
) -> Result {
|
||||
var u8 = self.nulTerminatedUTF8()
|
||||
return u8.buffer.withUnsafePointerToElements {
|
||||
return self.nulTerminatedUTF8.withUnsafePointerToElements {
|
||||
f(CString($0))
|
||||
}
|
||||
}
|
||||
@@ -111,8 +110,7 @@ extension String {
|
||||
func withCString<Result>(
|
||||
f: (UnsafePointer<CChar>)->Result
|
||||
) -> Result {
|
||||
var u8 = self.nulTerminatedUTF8()
|
||||
return u8.buffer.withUnsafePointerToElements {
|
||||
return self.nulTerminatedUTF8.withUnsafePointerToElements {
|
||||
f(UnsafePointer($0))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user