1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-15 13:31:05 +01:00

Table: Use std::vectors

This commit is contained in:
Eelco Dolstra 2025-12-01 20:12:15 +01:00
parent 863f6811e4
commit ab6dcf2047
3 changed files with 6 additions and 10 deletions

View file

@ -16,17 +16,15 @@ void printTable(Table & table)
for (auto & i : table) {
assert(i.size() == nrColumns);
Strings::iterator j;
size_t column;
for (j = i.begin(), column = 0; j != i.end(); ++j, ++column)
size_t column = 0;
for (auto j = i.begin(); j != i.end(); ++j, ++column)
if (j->size() > widths[column])
widths[column] = j->size();
}
for (auto & i : table) {
Strings::iterator j;
size_t column;
for (j = i.begin(), column = 0; j != i.end(); ++j, ++column) {
size_t column = 0;
for (auto j = i.begin(); j != i.end(); ++j, ++column) {
std::string s = *j;
replace(s.begin(), s.end(), '\n', ' ');
std::cout << s;