1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 06:43:24 +03:00

Use ContiguousArray instead of Array

- why not...
This commit is contained in:
Tae Won Ha 2018-07-22 14:34:38 +02:00
parent 9423783d7e
commit 24dafa81f1
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -102,7 +102,7 @@ class Grid: CustomStringConvertible {
foreground: defaultForeground, background: defaultBackground, special: defaultSpecial
)
private(set) var cells: [[Cell]] = []
private(set) var cells: ContiguousArray<ContiguousArray<Cell>> = []
var hasData: Bool {
return !self.cells.isEmpty
@ -120,8 +120,8 @@ class Grid: CustomStringConvertible {
let emptyCellAttrs = CellAttributes(fontTrait: .none,
foreground: self.foreground, background: self.background, special: self.special)
let emptyRow = Array(repeating: Cell(string: " ", attrs: emptyCellAttrs), count: size.width)
self.cells = Array(repeating: emptyRow, count: size.height)
let emptyRow = ContiguousArray(repeating: Cell(string: " ", attrs: emptyCellAttrs), count: size.width)
self.cells = ContiguousArray(repeating: emptyRow, count: size.height)
}
func clear() {