Skip to content

Commit

Permalink
fix(branch): print table
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Feb 20, 2025
1 parent 2134bd7 commit 3d58751
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bench/propagate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,13 @@ void printTable(List<String> headers, List<List<String>> rows) {
}
}

print(headers
.map((h) => h.padRight(colWidths[headers.indexOf(h)]))
.join(' | '));
print(colWidths.map((w) => '-' * w).join(' | '));
print(
'| ${headers.map((h) => h.padRight(colWidths[headers.indexOf(h)])).join(' | ')} |');
print('| ${colWidths.map((w) => '-' * math.max(w, 3)).join(' | ')} |');

for (final row in rows) {
print(row
.map((cell) => cell.padRight(colWidths[row.indexOf(cell)]))
.join(' | '));
print(
'| ${row.map((cell) => cell.padRight(colWidths[row.indexOf(cell)])).join(' | ')} |');
}
}

Expand Down

0 comments on commit 3d58751

Please sign in to comment.