From 140aa6afb4631d1388dcdbff2dab20497c0a889f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 8 Jul 2021 16:53:25 +0200 Subject: [PATCH] Preprocessor; do not write macro usage in dump output if it is empty --- lib/preprocessor.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/preprocessor.cpp b/lib/preprocessor.cpp index a170a8f0d..1ec1f75dd 100644 --- a/lib/preprocessor.cpp +++ b/lib/preprocessor.cpp @@ -958,19 +958,21 @@ void Preprocessor::dump(std::ostream &out) const } out << " " << std::endl; - out << " " << std::endl; - for (const simplecpp::MacroUsage ¯oUsage: mMacroUsage) { - out << " " << std::endl; + if (!mMacroUsage.empty()) { + out << " " << std::endl; + for (const simplecpp::MacroUsage ¯oUsage: mMacroUsage) { + out << " " << std::endl; + } + out << " " << std::endl; } - out << " " << std::endl; } static const std::uint32_t crc32Table[] = {