mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words
This commit is contained in:
@@ -100,7 +100,7 @@ class EOFCountingIterator<T> : IteratorProtocol {
|
||||
}
|
||||
|
||||
func next() -> T? {
|
||||
if index == array.count {
|
||||
if index == array.length {
|
||||
numTimesReturnedEOF += 1
|
||||
return .None
|
||||
}
|
||||
@@ -2141,7 +2141,7 @@ class NonContiguousNSString : NSString {
|
||||
}
|
||||
|
||||
@objc override var length: Int {
|
||||
return _value.count
|
||||
return _value.length
|
||||
}
|
||||
|
||||
@objc override func characterAt(index: Int) -> unichar {
|
||||
@@ -2189,7 +2189,7 @@ StringCookedViews.test("UTF8ForContiguousUTF16") {
|
||||
backingStorage.withUnsafeBufferPointer {
|
||||
(ptr) -> Void in
|
||||
let cfstring = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault,
|
||||
ptr.baseAddress, backingStorage.count, kCFAllocatorNull)
|
||||
ptr.baseAddress, backingStorage.length, kCFAllocatorNull)
|
||||
expectFalse(CFStringGetCStringPtr(cfstring,
|
||||
CFStringBuiltInEncodings.ASCII.rawValue) != nil)
|
||||
expectTrue(CFStringGetCharactersPtr(cfstring) != nil)
|
||||
@@ -2266,7 +2266,7 @@ StringCookedViews.test("UTF8ForNonContiguousUTF16Extra") {
|
||||
do {
|
||||
var bytes: [UInt8] = [ 97, 98, 99 ]
|
||||
var cfstring: CFString = CFStringCreateWithBytesNoCopy(
|
||||
kCFAllocatorDefault, bytes, bytes.count,
|
||||
kCFAllocatorDefault, bytes, bytes.length,
|
||||
CFStringBuiltInEncodings.MacRoman.rawValue, false, kCFAllocatorNull)
|
||||
|
||||
// Sanity checks to make sure we are testing the code path that does UTF-8
|
||||
@@ -2290,7 +2290,7 @@ StringCookedViews.test("UTF8ForNonContiguousUTF16Extra") {
|
||||
do {
|
||||
var bytes: [UInt8] = [ 97, 98, 99 ]
|
||||
var cfstring: CFString = CFStringCreateWithBytes(kCFAllocatorDefault,
|
||||
bytes, bytes.count, CFStringBuiltInEncodings.MacRoman.rawValue, false)
|
||||
bytes, bytes.length, CFStringBuiltInEncodings.MacRoman.rawValue, false)
|
||||
|
||||
// Sanity checks to make sure we are testing the code path that does UTF-8
|
||||
// encoding itself, instead of dispatching to CF.
|
||||
|
||||
Reference in New Issue
Block a user