From ce20f933bbc41841ce7ea04f1ee53506917b52bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Wed, 18 May 2022 16:07:05 +0200 Subject: [PATCH] JSON output: fix possible spurious commas in vector of int or string options (cherry picked from commit d64682f3466a577cc82338960941e27b5975ba27) --- src/Statement.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Statement.cc b/src/Statement.cc index 08fcd6a7..dcec5597 100644 --- a/src/Statement.cc +++ b/src/Statement.cc @@ -374,9 +374,7 @@ OptionsList::writeJsonOutput(ostream &output) const { output << *viit; ++viit; - if (viit != it->second.end() - || !(vector_str_options.empty() - && vector_cellstr_options.empty())) + if (viit != it->second.end()) output << ", "; } } @@ -401,8 +399,7 @@ OptionsList::writeJsonOutput(ostream &output) const { output << R"(")" << *viit << R"(")"; ++viit; - if (viit != it->second.end() - || !(vector_cellstr_options.empty())) + if (viit != it->second.end()) output << ", "; } } -- GitLab