mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
committed by
Max Moiseev
parent
824088a07d
commit
73ce9ae7e9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user