Skip to content

Commit

Permalink
Refactor: rename ValuePrinter::totalListItemsPrinted
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Jun 29, 2024
1 parent ce1dc87 commit bfc5416
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libexpr/print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class Printer
PrintOptions options;
std::optional<ValuesSeen> seen;
size_t totalAttrsPrinted = 0;
size_t listItemsPrinted = 0;
size_t totalListItemsPrinted = 0;
std::string indent;

void increaseIndent()
Expand Down Expand Up @@ -408,8 +408,8 @@ class Printer
for (auto elem : listItems) {
printSpace(prettyPrint);

if (listItemsPrinted >= options.maxListItems) {
printElided(listItems.size() - listItemsPrinted, "item", "items");
if (totalListItemsPrinted >= options.maxListItems) {
printElided(listItems.size() - totalListItemsPrinted, "item", "items");
break;
}

Expand All @@ -418,7 +418,7 @@ class Printer
} else {
printNullptr();
}
listItemsPrinted++;
totalListItemsPrinted++;
}

decreaseIndent();
Expand Down Expand Up @@ -592,7 +592,7 @@ class Printer
void print(Value & v)
{
totalAttrsPrinted = 0;
listItemsPrinted = 0;
totalListItemsPrinted = 0;
indent.clear();

if (options.trackRepeated) {
Expand Down

0 comments on commit bfc5416

Please sign in to comment.