Skip to content

Commit

Permalink
Refactor: rename ValuePrinter::totalAttrsPrinted
Browse files Browse the repository at this point in the history
Make it more distinct from the attrs printed of any specific
attrset.
  • Loading branch information
roberth committed Jun 29, 2024
1 parent 9b88bf8 commit ce1dc87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libexpr/print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Printer
EvalState & state;
PrintOptions options;
std::optional<ValuesSeen> seen;
size_t attrsPrinted = 0;
size_t totalAttrsPrinted = 0;
size_t listItemsPrinted = 0;
std::string indent;

Expand Down Expand Up @@ -350,7 +350,7 @@ class Printer
for (auto & i : sorted) {
printSpace(prettyPrint);

if (attrsPrinted >= options.maxAttrs) {
if (totalAttrsPrinted >= options.maxAttrs) {
printElided(sorted.size() - currentAttrsPrinted, "attribute", "attributes");
break;
}
Expand All @@ -359,7 +359,7 @@ class Printer
output << " = ";
print(*i.second, depth + 1);
output << ";";
attrsPrinted++;
totalAttrsPrinted++;
currentAttrsPrinted++;
}

Expand Down Expand Up @@ -591,7 +591,7 @@ class Printer

void print(Value & v)
{
attrsPrinted = 0;
totalAttrsPrinted = 0;
listItemsPrinted = 0;
indent.clear();

Expand Down

0 comments on commit ce1dc87

Please sign in to comment.