chapter2 12_Subscripts.md 替换4.0前过时的方法 (#776)

This commit is contained in:
liuyanhong
2018-04-12 16:10:53 +08:00
committed by 安正超
parent ec82cbd6fe
commit 78e2e93ae0

View File

@ -100,7 +100,7 @@ struct Matrix {
init(rows: Int, columns: Int) {
self.rows = rows
self.columns = columns
grid = Array(count: rows * columns, repeatedValue: 0.0)
grid = Array(repeating: 0.0, count: rows * columns)
}
func indexIsValidForRow(row: Int, column: Int) -> Bool {
return row >= 0 && row < rows && column >= 0 && column < columns