Avatar
↓を 1 から 10_000_000 まで試した。 func testDictionary_1() { var dictionary: [Int: Int] = .init(uniqueKeysWithValues: (0..<1).map { ($0, $0 + 1) }) XCTAssertEqual(dictionary.count, 1) let count = dictionary.count measure { for i in 0..<n { let key = i % count dictionary[key] = i + 2 XCTAssertEqual(dictionary[key], i + 2) } } } (edited)