@@ -119,8 +119,7 @@ typedef struct JsonScalarStats
119
119
* XXX This seems rather complicated and needs simplification. We're not
120
120
* really using all the various JsonScalarStats bits, there's a lot of
121
121
* duplication (e.g. each JsonScalarStats contains it's own array, which
122
- * has a copy of data from the one in "jsons"). Some of it is defined as
123
- * a typedef, but booleans have inline struct.
122
+ * has a copy of data from the one in "jsons").
124
123
*/
125
124
typedef struct JsonValueStats
126
125
{
@@ -134,14 +133,9 @@ typedef struct JsonValueStats
134
133
JsonScalarStats lens ; /* stats of object/array lengths */
135
134
JsonScalarStats arrlens ; /* stats of array lengths */
136
135
137
- /* stats for booleans */
138
- struct
139
- {
140
- int ntrue ;
141
- int nfalse ;
142
- } booleans ;
143
-
144
136
int nnulls ; /* number of JSON null values */
137
+ int ntrue ; /* number of JSON true values */
138
+ int nfalse ; /* number of JSON false values */
145
139
int nobjects ; /* number of JSON objects */
146
140
int narrays ; /* number of JSON arrays */
147
141
int nstrings ; /* number of JSON strings */
@@ -358,9 +352,9 @@ jsonAnalyzeJsonValue(JsonAnalyzeContext *ctx, JsonValueStats *vstats,
358
352
359
353
case jbvBool :
360
354
if (jv -> val .boolean )
361
- vstats -> booleans . ntrue ++ ;
355
+ vstats -> ntrue ++ ;
362
356
else
363
- vstats -> booleans . nfalse ++ ;
357
+ vstats -> nfalse ++ ;
364
358
break ;
365
359
366
360
case jbvString :
@@ -792,8 +786,7 @@ jsonAnalyzeBuildPathStats(JsonPathAnlStats *pstats)
792
786
vstats -> jsons .values .count );
793
787
794
788
pushJsonbKeyValueFloat (& ps , & val , "freq_boolean" ,
795
- freq * (vstats -> booleans .nfalse +
796
- vstats -> booleans .ntrue ) /
789
+ freq * (vstats -> nfalse + vstats -> ntrue ) /
797
790
vstats -> jsons .values .count );
798
791
799
792
pushJsonbKeyValueFloat (& ps , & val , "freq_string" ,
0 commit comments