Skip to content

Commit

Permalink
Use a forEach for adding TextTableObject values.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrhoyt committed Mar 11, 2016
1 parent c4ec900 commit 3a99958
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Source/SwiftyTextTable/TextTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ public struct TextTable {

public init<T: TextTableObject>(objects: [T]) {
columns = objects.isEmpty ? [] : objects[0].dynamicType.tableHeaders.map { TextTableColumn(header: $0) }
for object in objects {
addRow(object.tableValues)
}
objects.forEach { addRow($0.tableValues) }
}

public mutating func addRow(values: [CustomStringConvertible]) {
Expand Down

0 comments on commit 3a99958

Please sign in to comment.