From 7309c7817d25f97c7eeef4e5632e402e9d95de3a Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Tue, 19 Feb 2019 13:08:07 +0000 Subject: [PATCH] in spacetojson: if there is only one item then do not put it in the table git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1170 e52654a7-88a9-db11-a3e9-0013d4bc506e --- space/spacetojson.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/space/spacetojson.h b/space/spacetojson.h index 03c9d44..f18ac3f 100644 --- a/space/spacetojson.h +++ b/space/spacetojson.h @@ -163,7 +163,8 @@ bool is_special; PrintToken(out, i2->first); out << L": "; - out << '['; + if( i2->second.size() != 1 ) + out << '['; for(v = 0 ; v < i2->second.size() ; ++v) { @@ -176,7 +177,8 @@ bool is_special; out << L",\n"; } - out << ']'; + if( i2->second.size() != 1 ) + out << ']'; if( index + 1 < space.table.size() ) out << ',';