From 1c5f5d4291df7bf80806e57c75d2ec67bced8616 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 8 Feb 2024 10:17:20 -0800 Subject: [PATCH] `prettyPrint` -> `shouldPrettyPrint` --- src/libexpr/print-options.hh | 2 +- src/libexpr/print.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libexpr/print-options.hh b/src/libexpr/print-options.hh index 94767df9c..6c5e80c61 100644 --- a/src/libexpr/print-options.hh +++ b/src/libexpr/print-options.hh @@ -71,7 +71,7 @@ struct PrintOptions /** * True if pretty-printing is enabled. */ - inline bool prettyPrint() + inline bool shouldPrettyPrint() { return prettyIndent > 0; } diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index cdc9f6dbe..a8eac8288 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -168,14 +168,14 @@ private: void increaseIndent() { - if (options.prettyPrint()) { + if (options.shouldPrettyPrint()) { indent.append(options.prettyIndent, ' '); } } void decreaseIndent() { - if (options.prettyPrint()) { + if (options.shouldPrettyPrint()) { assert(indent.size() >= options.prettyIndent); indent.resize(indent.size() - options.prettyIndent); } @@ -279,7 +279,7 @@ private: bool shouldPrettyPrintAttrs(AttrVec & v) { - if (!options.prettyPrint() || v.empty()) { + if (!options.shouldPrettyPrint() || v.empty()) { return false; } @@ -356,7 +356,7 @@ private: bool shouldPrettyPrintList(std::span list) { - if (!options.prettyPrint() || list.empty()) { + if (!options.shouldPrettyPrint() || list.empty()) { return false; }