Collection.count => .length

And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
This commit is contained in:
Dmitri Gribenko
2015-11-09 17:49:12 -08:00
committed by Max Moiseev
parent 824088a07d
commit 73ce9ae7e9
188 changed files with 2075 additions and 2046 deletions

View File

@@ -74,7 +74,7 @@ func nsEncode<CodeUnit>(
inout _ used: Int
) {
var c = c
_require(buffer.count >= 4, "buffer is not large enough")
_require(buffer.length >= 4, "buffer is not large enough")
let s = NSString(
bytes: &c,
@@ -83,7 +83,7 @@ func nsEncode<CodeUnit>(
s.getBytes(
&buffer,
maxLength: buffer.count,
maxLength: buffer.length,
usedLength: &used,
encoding: encoding,
options: [],
@@ -94,8 +94,8 @@ func nsEncode<CodeUnit>(
class CodecTest<Codec : TestableUnicodeCodec> {
var used = 0
typealias CodeUnit = Codec.CodeUnit
var nsEncodeBuffer: [CodeUnit] = Array(repeating: 0, count: 4)
var encodeBuffer: [CodeUnit] = Array(repeating: 0, count: 4)
var nsEncodeBuffer: [CodeUnit] = Array(repeating: 0, length: 4)
var encodeBuffer: [CodeUnit] = Array(repeating: 0, length: 4)
func testOne(scalar: UnicodeScalar) {
/* Progress reporter