Skip to content

Commit

Permalink
Used different syntax for Swift 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrhoyt committed Feb 4, 2016
1 parent df57a10 commit 6dbd0e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/SwiftyTextTable/TextTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ public struct TextTable {
}

public mutating func addRow(values: CustomStringConvertible...) {
let values = values.count >= columns.count ? values :
values + [CustomStringConvertible](count: columns.count - values.count, repeatedValue: "")
var values = values
if values.count < columns.count {
let blank: CustomStringConvertible = ""
values.appendContentsOf([CustomStringConvertible](count: columns.count - values.count, repeatedValue: blank))
}
columns = zip(columns, values).map {
(column, value) in
var column = column
Expand Down

0 comments on commit 6dbd0e8

Please sign in to comment.