Skip to content

Commit 05262fe

Browse files
committed
More TypeAliases for better readability
1 parent cdb35b3 commit 05262fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/libhostmgr/CLI/Console.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ extension Console {
171171

172172
// MARK: Table Support
173173
extension Console {
174-
public typealias Table = [[String]]
174+
175+
public typealias TableRow = [String]
176+
public typealias Table = [TableRow]
175177

176178
func columnCounts(for table: Table) -> [Int] {
177179
transpose(matrix: table).map { $0.map(\.count).max() ?? 0 }
@@ -182,7 +184,7 @@ extension Console {
182184
return matrix
183185
}
184186

185-
var newTable = [[String]](repeating: [String](repeating: "", count: matrix.count), count: numberOfColumns)
187+
var newTable = Table(repeating: TableRow(repeating: "", count: matrix.count), count: numberOfColumns)
186188

187189
for (rowIndex, row) in matrix.enumerated() {
188190
for (colIndex, col) in row.enumerated() {

0 commit comments

Comments
 (0)